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 107146 - Panel sends incorrect background pixmap to applets.
Panel sends incorrect background pixmap to applets.
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 107759 (view as bug list)
Depends on:
Blocks: 108124
 
 
Reported: 2003-02-26 20:16 UTC by John Ellis
Modified: 2015-03-24 13:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.1/2.2


Attachments
Fixes the pixmap image sent to applets in change_background signal. (6.13 KB, patch)
2003-03-01 19:04 UTC, John Ellis
none Details | Review
gen_util clock debug window for pixmap backgrounds (1.98 KB, patch)
2003-03-10 05:04 UTC, John Ellis
none Details | Review

Description John Ellis 2003-02-26 20:16:33 UTC
In panel-background.c, the Drawable id (pixmap_xid) sent to an applet is
for background->window, which would seem correct - but the problem is that
the areas of the window that are covered by other widgets (such as the
applet itself) are not correct, and seem to be random data.

The result is that the pixmap returned from both the "change_background"
signal and panel_applet_get_background() is unusable.


A second, related problem is that the change_background signal is only
generated when the background preferences for the panel are changed. It
should also be sent when the applet is moved and/or resized.
Comment 1 John Ellis 2003-03-01 19:04:29 UTC
Created attachment 14715 [details] [review]
Fixes the pixmap image sent to applets in change_background signal.
Comment 2 John Ellis 2003-03-01 19:07:27 UTC
Added a patch that fixes this bug.

It creates a secondary pixmap that is used as a mirror of the panel
background. This pixmap is what is used for the applets background.

On size_allocate signal for an applet-frame, the change_background
signal is sent if the background settings result in an image. This is
needed for correct backgrounds in startup and moving/sizing applets.

The only possible problem is when using more than one display, as the
change to panel-applet.c is simply using the default display for the
pixmap_foreign* calls.

This patch is needed for applets with 'true' transparency, like those
on gqapplets.sf.net, which are being ported to GNOME 2.2 from 1.4.
Comment 3 John Ellis 2003-03-01 19:31:31 UTC
Added PATCH keyword, apparently someone loves patches :)
Comment 4 Mark McLoughlin 2003-03-02 20:23:10 UTC
John: thanks for the patch - it looks along the right track, I'll
review it properly soon.
Comment 5 Mark McLoughlin 2003-03-09 22:43:05 UTC
John: we already have a backing store pixmap for the background which
the applet could copy from so the patch for panel-background.c should
be as simple as:

@@ -813,15 +813,13 @@ panel_background_make_string (PanelBackg
        char *retval = NULL;
                                                                     
                                       
        if (background->type == PANEL_BACK_IMAGE ||
-           (background->type == PANEL_BACK_COLOR &&
background->has_alpha) ||
-           (background->type == PANEL_BACK_NONE &&
background->default_pixmap)) {
+           (background->type == PANEL_BACK_COLOR &&
background->has_alpha)) {
                GdkNativeWindow pixmap_xid;
                                                                     
                                       
-               if (!background->window)
+               if (!background->pixmap)
                        return NULL;
                                                                     
                                       
-               pixmap_xid = gdk_x11_drawable_get_xid (
-                               GDK_DRAWABLE (background->window));
+               pixmap_xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE
(background->pixmap));
                                                                     
                                       
                retval = g_strdup_printf ("pixmap:%d,%d,%d",
pixmap_xid, x, y);



i.e. send the XID of background->pixmap rather than
background->window. Note that for PANEL_BACK_NONE, we shouldn't send
anything to the applet ... it should just respect GtkRcStyle.

I had a quick go at making this work for the clock applet without
success. Could you possible do a new version of your patch with the
change I recommend to panel-background.c and also a patch to get it
working for the clock applet so we can test it. It'd be much
appreciated.                                                         
                                                   
Comment 6 John Ellis 2003-03-10 05:00:12 UTC
I too tried simply using background->pixmap with no success.

Also the patch addresses image tiling: the background->pixmap can be
smaller than the window, which then will not work with the x,y offset
coordinates of the applet (the resulting area may be outside the pixmap).

For the panel, the pixmap is set to the background->window with
gdk_window_set_back_pixmap, which will tile the pixmap for the panel
window automatically. The created copy in my patch accounts for tiling
the pixmap if necessary. I see no way around this as the applet is
supposed to be given a pixmap for the exact part of the panel it covers.

The clock applet cannot simply gdk_window_set_back_pixap the pixmap
onto applet->window, not sure exactly how to fix it.

I have attached a small clock applet debugging patch you can use that
displays the pixmap sent to the applet in a small window. It is
against gen_util applet clock.c. At least with this, the panel side of
the background signals can be tested :)
Comment 7 John Ellis 2003-03-10 05:04:48 UTC
Created attachment 14883 [details] [review]
gen_util clock debug window for pixmap backgrounds
Comment 8 Mark McLoughlin 2003-03-10 05:19:43 UTC
Thanks for that John. You're right about the tiling problem, though I
think we'll just tile client side because that's what we do if the
image has an alpha channel.

I too did the little debug window thing for the clock applet, but
couldn't actually figure out how to get the background working :-)
Comment 9 Mark McLoughlin 2003-04-15 05:59:51 UTC
*** Bug 107759 has been marked as a duplicate of this bug. ***
Comment 10 Kjartan Maraas 2003-04-22 15:45:26 UTC
Is this any closed to being resolved?
Comment 11 Loban Rahman 2003-05-22 01:51:50 UTC
Ping? Is anyone working on this atm?
Comment 12 teresa gutierrez 2003-10-20 23:05:55 UTC
Debugging Information:

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
0x405ae669 in __wait4 () from /lib/i686/libc.so.6
  • #0 __wait4
    from /lib/i686/libc.so.6
  • #1 __DTOR_END__
    from /lib/i686/libc.so.6
  • #2 gnome_segv_handle
    from /usr/lib/libgnomeui.so.32
  • #3 <signal handler called>
  • #4 __libc_free
    at malloc.c line 3155
  • #5 g_free
    from /usr/lib/libglib-1.2.so.0
  • #6 free_sections
    from /usr/lib/libgnome.so.32
  • #7 free_profile
    from /usr/lib/libgnome.so.32
  • #8 free_profile
    from /usr/lib/libgnome.so.32
  • #9 free_profile
    from /usr/lib/libgnome.so.32
  • #10 free_profile
    from /usr/lib/libgnome.so.32
  • #11 free_profile
    from /usr/lib/libgnome.so.32
  • #12 free_profile
    from /usr/lib/libgnome.so.32
  • #13 free_profile
    from /usr/lib/libgnome.so.32
  • #14 free_profile
    from /usr/lib/libgnome.so.32
  • #15 free_profile
    from /usr/lib/libgnome.so.32
  • #16 free_profile
    from /usr/lib/libgnome.so.32
  • #17 free_profile
    from /usr/lib/libgnome.so.32
  • #18 gnome_config_drop_all
  • #19 gnome_config_sync
    from /usr/lib/libgnome.so.32
  • #20 save_next_applet
    at eval.c line 41
  • #21 panel_config_sync
    at eval.c line 41
  • #22 start_screen_check
    at eval.c line 41
  • #23 g_timeout_dispatch
    from /usr/lib/libglib-1.2.so.0
  • #24 g_main_dispatch
    from /usr/lib/libglib-1.2.so.0
  • #25 g_main_iterate
    from /usr/lib/libglib-1.2.so.0
  • #26 g_main_run
    from /usr/lib/libglib-1.2.so.0
  • #27 gtk_main
    from /usr/lib/libgtk-1.2.so.0
  • #28 main
    at eval.c line 41
  • #29 __libc_start_main
    at ../sysdeps/generic/libc-start.c line 129
  • #0 __wait4
    from /lib/i686/libc.so.6
  • #1 __DTOR_END__
    from /lib/i686/libc.so.6
  • #2 gnome_segv_handle
    from /usr/lib/libgnomeui.so.32
  • #3 <signal handler called>
  • #4 __libc_free
    at malloc.c line 3155
  • #5 g_free
    from /usr/lib/libglib-1.2.so.0
  • #6 free_sections
    from /usr/lib/libgnome.so.32
  • #7 free_profile
    from /usr/lib/libgnome.so.32

Comment 13 Vincent Untz 2003-10-28 17:09:25 UTC
See patch in bug #107617.
Comment 14 Vincent Untz 2003-11-03 16:28:20 UTC
This is fixed (thanks John: parts of the fix are coming from your
patch). See bug #107617. There's one problem left, though: applets
keep coming back to a coloured background instead of using the pixmap.