After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 475909 - In GTK 2.10.x, scroll bar buttons are sized too large when GTK_CAN_FOCUS flag is set
In GTK 2.10.x, scroll bar buttons are sized too large when GTK_CAN_FOCUS flag...
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-09-11 16:27 UTC by Bogdan Gheorghe
Modified: 2015-12-21 23:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
test case updated for gtk3 (1.09 KB, text/x-csrc)
2013-03-26 16:10 UTC, William Jon McCann
Details

Description Bogdan Gheorghe 2007-09-11 16:27:38 UTC
Please describe the problem:
In the GTK 2.10.x stream, setting the GTK_CAN_FOCUS flag on a scrollbar causes the end buttons of the scrollbar to be sized taller then the scollbar itself. 

Steps to reproduce:
Here is a code snippet that illustrates the problem:
=============================================================

#include <gtk/gtk.h>

// build with :
//	gcc scrollBar.c -o scrollBar  `pkg-config --cflags --libs gtk+-2.0`

int main (int argc, char** argv) {
	GtkWidget *shellHandle, *scrollBar;
	GtkObject *hAdjustment;

	gtk_init_check (&argc, &argv);
	shellHandle = gtk_window_new (GTK_WINDOW_TOPLEVEL);

	hAdjustment = gtk_adjustment_new (0, 0, 100, 1, 10, 10);	
	scrollBar = gtk_hscrollbar_new (GTK_ADJUSTMENT(hAdjustment));
	GTK_WIDGET_SET_FLAGS(scrollBar, GTK_CAN_FOCUS);

	gtk_container_add (GTK_CONTAINER (shellHandle), scrollBar);
	
	
	printf ("GTK version %i.%i.%i\n", gtk_major_version, gtk_minor_version, gtk_micro_version);

	g_signal_connect (G_OBJECT (shellHandle), "destroy", G_CALLBACK (gtk_main_quit), NULL);
	g_signal_connect (G_OBJECT (shellHandle), "delete_event",G_CALLBACK (gtk_main_quit), NULL);

     	gtk_window_set_default_size(GTK_WINDOW(shellHandle), 200, 200);
 	gtk_window_move (GTK_WINDOW(shellHandle), 200, 200);
	gtk_widget_show_all (shellHandle);
	gtk_main();

}


Actual results:
When you run the above snippet, a window will pop up with a scrollbar in it. The scrollbar's end buttons will be badly sized if you are running against GTK 2.10.x (note that 2.8, 2.6 and 2.4 all work as expected with the above code). Note that if you comment out the GTK_WIDGET_SET_FLAGS line, everything works as expected.

Expected results:
I expect the buttons to be the same size as the scrollbar. 

Does this happen every time?
Yes.

Other information:
Comment 1 Bogdan Gheorghe 2007-09-11 16:29:04 UTC
One more thing to add: this only affects horizontal scrollbars (ie. gtk_hscrollbar_new) - vertical scrollbars still work as expected.
Comment 2 William Jon McCann 2013-03-26 16:10:02 UTC
Created attachment 239876 [details]
test case updated for gtk3

Still an issue for GTK2. But less of one for GTK3 since high contrast and adwaita don't use stepper buttons by default. However, if you have a theme with steppers this is still present in 3.
Comment 3 Matthias Clasen 2015-12-21 23:51:20 UTC
time to close this. not going to fix this in gtk2 at this point