From: Thierry Lorthiois Date: Sat, 6 Jun 2009 19:37:27 +0000 (+0000) Subject: add wm_menu config option to disable window manager s menu X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=0fb8a9c21818afd0c742771e46c0e5b57cb3b70c;p=chaz%2Ftint2 add wm_menu config option to disable window manager s menu --- diff --git a/ChangeLog b/ChangeLog index 41a0044..a99f1b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-06 +- add 'wm_menu' config option to disable window manager's menu + if you don't specify "wm_menu = ", the default value will show WM menu. + 2009-06-06 - fixed issue 90 and issue 81 : window manager's menu in panel padding works on openbox and pekwm. doesn't work on xfce, windowmaker ? diff --git a/src/config.c b/src/config.c index bfe8801..afeb071 100644 --- a/src/config.c +++ b/src/config.c @@ -75,6 +75,8 @@ void init_config() list_back = g_slist_append(0, calloc(1, sizeof(Area))); panel_config = calloc(1, sizeof(Panel)); + // window manager's menu default value == true + wm_menu = 1; } @@ -308,6 +310,8 @@ void add_entry (char *key, char *value) memcpy(&panel_config->area.pix.back, &a->pix.back, sizeof(Color)); memcpy(&panel_config->area.pix.border, &a->pix.border, sizeof(Border)); } + else if (strcmp (key, "wm_menu") == 0) + wm_menu = atoi (value); /* Battery */ else if (strcmp (key, "battery") == 0) { diff --git a/src/panel.c b/src/panel.c index 4e8547e..00e75de 100644 --- a/src/panel.c +++ b/src/panel.c @@ -40,6 +40,7 @@ int mouse_scroll_up; int mouse_scroll_down; int panel_mode; +int wm_menu; int panel_position; int panel_refresh; diff --git a/src/panel.h b/src/panel.h index 8e0c305..ef4f33c 100644 --- a/src/panel.h +++ b/src/panel.h @@ -34,6 +34,7 @@ extern int mouse_scroll_down; //panel mode enum { SINGLE_DESKTOP=0, MULTI_DESKTOP, SINGLE_MONITOR }; extern int panel_mode; +extern int wm_menu; //panel position enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 }; diff --git a/src/tint.c b/src/tint.c index 568375b..1429adf 100644 --- a/src/tint.c +++ b/src/tint.c @@ -136,13 +136,15 @@ void event_button_press (XEvent *e) Panel *panel = get_panel(e->xany.window); if (!panel) return; - if ((e->xbutton.x < panel->area.paddingxlr) || (e->xbutton.x > panel->area.width-panel->area.paddingxlr) || (e->xbutton.y < panel->area.paddingy) || (e->xbutton.y > panel->area.paddingy+panel->g_taskbar.height)) { - // forward the click to the desktop window (thanks conky) - XUngrabPointer(server.dsp, e->xbutton.time); - e->xbutton.window = server.root_win; - XSetInputFocus(server.dsp, e->xbutton.window, RevertToParent, e->xbutton.time); - XSendEvent(server.dsp, e->xbutton.window, False, ButtonPressMask, e); - return; + if (wm_menu) { + if ((e->xbutton.x < panel->area.paddingxlr) || (e->xbutton.x > panel->area.width-panel->area.paddingxlr) || (e->xbutton.y < panel->area.paddingy) || (e->xbutton.y > panel->area.paddingy+panel->g_taskbar.height)) { + // forward the click to the desktop window (thanks conky) + XUngrabPointer(server.dsp, e->xbutton.time); + e->xbutton.window = server.root_win; + XSetInputFocus(server.dsp, e->xbutton.window, RevertToParent, e->xbutton.time); + XSendEvent(server.dsp, e->xbutton.window, False, ButtonPressMask, e); + return; + } } if (e->xbutton.button != 1) return; @@ -183,11 +185,13 @@ void event_button_release (XEvent *e) Panel *panel = get_panel(e->xany.window); if (!panel) return; - if ((e->xbutton.x < panel->area.paddingxlr) || (e->xbutton.x > panel->area.width-panel->area.paddingxlr) || (e->xbutton.y < panel->area.paddingy) || (e->xbutton.y > panel->area.paddingy+panel->g_taskbar.height)) { - // forward the click to the desktop window (thanks conky) - e->xbutton.window = server.root_win; - XSendEvent(server.dsp, e->xbutton.window, False, ButtonReleaseMask, e); - return; + if (wm_menu) { + if ((e->xbutton.x < panel->area.paddingxlr) || (e->xbutton.x > panel->area.width-panel->area.paddingxlr) || (e->xbutton.y < panel->area.paddingy) || (e->xbutton.y > panel->area.paddingy+panel->g_taskbar.height)) { + // forward the click to the desktop window (thanks conky) + e->xbutton.window = server.root_win; + XSendEvent(server.dsp, e->xbutton.window, False, ButtonReleaseMask, e); + return; + } } int action = TOGGLE_ICONIFY; @@ -298,11 +302,13 @@ void event_property_notify (XEvent *e) } // Window list else if (at == server.atom._NET_CLIENT_LIST) { + //printf("Window list\n"); task_refresh_tasklist(); panel_refresh = 1; } // Change active else if (at == server.atom._NET_ACTIVE_WINDOW) { + //printf("Change active\n"); GSList *l0; if (task_active) { for (i=0 ; i < nb_panel ; i++) { diff --git a/src/tint2 b/src/tint2 index b33f320..e7f23f5 100755 Binary files a/src/tint2 and b/src/tint2 differ