all repos — tint2 @ 58013e2e0c78022e89338660859c2ec39ec58d63

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

add wm_menu config option to disable window manager s menu

git-svn-id: http://tint2.googlecode.com/svn/trunk@88 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

58013e2e0c78022e89338660859c2ec39ec58d63

parent

dd7ac54a403ec3e053979bbcf61db9f54a4fe92a

6 files changed, 28 insertions(+), 12 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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 ?
M src/config.csrc/config.c

@@ -75,6 +75,8 @@ // append full transparency background

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 @@ Area *a = g_slist_nth_data(list_back, id);

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) {
M src/panel.csrc/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;
M src/panel.hsrc/panel.h

@@ -34,6 +34,7 @@

//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 };
M src/tint.csrc/tint.c

@@ -136,13 +136,15 @@ {

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 @@ {

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 @@ }

} // 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++) {