Main index > Off the wall > PATCH for consistent desktop menu behavior

By drphibes (User), on Tue Feb 14 11:43:29 2006: PATCH for consistent desktop menu behavior.

I run a XFCE4 desktop and I use the adesklets configure option --enable-control-on-context-menu to require that CNTL be pressed for the desklet menu to appear when right-clicking over it.

There is a subtle problem with passing the menu requests through to the desktop that I don't think people have reported yet. On an empty XFCE4 desktop, to bring up a menu, you can either: right-click (button 3) and release quickly, OR, you can right-click and hold, i.e. do NOT release the button. When you right-click and hold, the menu will appear and you can either make a selection, or dismiss it by releasing the button.

With --enable-control-on-context-menu, only one of these two methods works: right-click and release. right-click and hold does not bring up the menu, thus making adesklets mouse behavior *slightly* inconsistent with the rest of the desktop.

Below is a one-line patch I wrote to fix the problem. All you need to do is ungrab the pointer on a button press event before sending the event to the desktop window.

Code:

--- src/adesklets.c.old 2006-02-14 01:49:01.000000000 -0500
+++ src/adesklets.c     2006-02-14 01:49:54.000000000 -0500
@@ -2910,6 +2910,7 @@
 #ifdef CONTROL_ON_CONTEXT_MENU
              } else {
+               XUngrabPointer(adesklets.display, ev.xbutton.time);
                ev.xbutton.window = adesklets.root ;
                XSendEvent(adesklets.display, ev.xbutton.window,
                           False, ButtonPressMask, &ev);
                debug("menu call redirected to root\n");



I hope you can put this patch in the forthcoming 0.5.1 release. Also reference my comments on the gentoo ebuild changes required when patching here:

http://adesklets.sourceforge.net/forum/viewtopic.php?p=1657#1657

By syfou (Core Developer & Desklet Author), on Mon Feb 20 16:59:37 2006.

An updated ebuild conditionally applying the patch has been submitted to gentoo bugzilla; I probably won't include it in adesklets code-base, because it doesn't perform as expected on neither XFree or Irix X11; it also have unwanted repercussion on fluxbox derivatives under X.org implementation (you absolutely have to keep the pointer button down, which is not perfectly consistent with the rest of the desktop either).

I haven't had time to write a better solution though, so I'll stick with yours from now. Yours,


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.