GNOME Bugzilla – Bug 118575
Buttons in notebook tabs are unclickable.
Last modified: 2011-02-04 16:12:10 UTC
Buttons in notebook tabs don't respond to mouse clicksThis is with the dropline.net runtime and build envirnoment (their version 2.2.1.2). This works fine on a Red Hat 9 system with gtk+ 2.2.1.
Created attachment 18717 [details] notebook example with some buttons in tabs.
I tested also with the packages from http://www.gimp.org/~tml/gimp/win32/downloads.html with the same results.
(Understanding the following comments require knowledge of the gtknotebook.c source code and gdk/win32 workings.) This seem to be beause the notebook's "event_window" and the tab's "tab_label" window are siblings, and the tab_label window is below the event_window in the Z-order. Both the event_window and tab_label window are GDK_INPUT_ONLY, which means their extended style has WS_EX_TRANSPARENT. The windows are shown in the order tab_label first, then event_window. show_window_internal in gdkwindow-win32.c has this interesting code snippet: if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT) { /* Don't really know if this makes sense, can't remember whether * this case is handled like this because it is necessary, or * if this is just old crap. */ SetWindowPos(GDK_WINDOW_HWND (window), HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE); return; } So it seems that this code snippet will set the event_window's Z- order position to be in front of tab_label's. Will check what happens if that code is removed.
Yes indeed, ifdeffing out that code helps. Now, the interesting question is, will this break something else... or was the code totally unnecessary. Will try to see if I can notice any change in the behaviour of testgtk, gtk-demo and GIMP.
*** Bug 121851 has been marked as a duplicate of this bug. ***
The dubious code removed from HEAD and gtk-2-2.