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 587510 - Background image alignment is wrong
Background image alignment is wrong
Status: RESOLVED FIXED
Product: libgnomekbd
Classification: Core
Component: Indicator
2.26.x
Other All
: Normal trivial
: ---
Assigned To: libgnomekbd maintainers
Sergey V. Udaltsov
Depends on:
Blocks:
 
 
Reported: 2009-07-01 11:47 UTC by Eugene Yashchenko
Modified: 2009-12-09 02:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Incorrect alignment (4.38 KB, image/png)
2009-07-01 11:57 UTC, Eugene Yashchenko
  Details
Hides visible windows for event boxes (496 bytes, patch)
2009-10-08 04:06 UTC, Robert Ancell
none Details | Review

Description Eugene Yashchenko 2009-07-01 11:47:21 UTC
Please describe the problem:
When you change a panel's background all applets apply it too. But gnome-keyboard-applet shifts it one or two pixels down (if the panel has bottom orientation) thus producing an ugly gap on the panel.

Steps to reproduce:
1. add a gnome-keyboard-applet (gswitchit) to the panel.
2. apply a background image to the panel
3. look at the keyboard applet


Actual results:
An image is shifted for one or two pixels down.

Expected results:
A background image looks identically to other applet's ones.

Does this happen every time?
Always.

Other information:
Comment 1 Eugene Yashchenko 2009-07-01 11:57:07 UTC
Created attachment 137684 [details]
Incorrect alignment
Comment 2 Robert Ancell 2009-10-08 04:05:51 UTC
This is a bug in libgnomekbd where the widget for this control is not making the event box window invisible
Comment 3 Robert Ancell 2009-10-08 04:06:49 UTC
Created attachment 145017 [details] [review]
Hides visible windows for event boxes
Comment 4 Sergey V. Udaltsov 2009-10-08 21:53:44 UTC
Actually, I could not reproduce that problem. But your patch seems ok for me. Committed.
Comment 5 Eugene Yashchenko 2009-10-14 05:09:39 UTC
Thank you, Sergey. Offtop: can we hope to see this patch in the nearest updates of karmic?
Comment 6 Robert Ancell 2009-10-14 05:39:36 UTC
Eugene, this patch is already released in Karmic
Comment 7 Sergey V. Udaltsov 2009-11-15 23:02:17 UTC
This patch breaks the behaviour of the indicator in case flags are used. The layout switching using mouse click does not work any more in that scenario.

Yes, I know, this is undocumented feature - but still it is VERY popular among users. I will try to find come compromize. Or I will have to revert the patch.
Comment 8 Sergey V. Udaltsov 2009-11-15 23:58:53 UTC
The trouble is that I still cannot reproduce the original issue - but I can reproduce the issue with flags ignoring clicks. Eugene, could you please check?

A couple of ideas - would you try setting the border width for either ebox or align to 0 explicitly? Or any other modification of the containers that would eliminate that 1-pixel border that I do not see:(

I need ebox visible because otherwise clicks are ignored
Comment 9 Sergey V. Udaltsov 2009-11-16 01:20:44 UTC
Actually I can reproduce that, after some playing.

For example, the panel size is 24.

With the patch, i.e. with invisible ebox, I am getting the following offsets of widgets to their parents:

widget parent    offsetx  offsety   border(of the widget)
---------------------------------------------------------
ebox   notebook  1        1         0
align  ebox      1        1         2
label  align     3        3

Without the patch, i.e. with visible ebox, I see the following:

widget parent    offsetx  offsety   border(of the widget)
---------------------------------------------------------
ebox   notebook  1        1         0
align  ebox      0        0         2
label  align     2        2

That is why label is 1 pixel higher, comparing to the patched version.

Anyone has ideas why is that so?? Why does visible ebox allocates 1 pixel around align - even if the border is 0?
Comment 10 Eugene Yashchenko 2009-11-16 05:51:50 UTC
Maybe it takes some padding from gtkrc? I found out that not every theme leads to the incorrect align, but i'm not very familiar with gtkrc format so don't know where to look at.
Comment 11 Sergey V. Udaltsov 2009-12-09 02:08:11 UTC
Actually, the answer was found in the documentation on gtk_event_box_set_visible_window:

There is one unexpected issue for an invisible event box that has its window below the child. (See gtk_event_box_set_above_child().) Since the input-only window is not an ancestor window of any windows that descendent widgets of the event box create, events on these windows aren't propagated up by the windowing system, but only by GTK+. The practical effect of this is if an event isn't in the event mask for the descendant window (see gtk_widget_add_events()), it won't be received by the event box.

So, once I used gtk_widget_add_events, it is working again!