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
This commit is contained in:
lorthiois@bbsoft.fr 2009-06-06 19:37:27 +00:00
parent dd7ac54a40
commit 58013e2e0c
6 changed files with 28 additions and 12 deletions

View file

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

View file

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

View file

@ -40,6 +40,7 @@ int mouse_scroll_up;
int mouse_scroll_down;
int panel_mode;
int wm_menu;
int panel_position;
int panel_refresh;

View file

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

View file

@ -136,6 +136,7 @@ void event_button_press (XEvent *e)
Panel *panel = get_panel(e->xany.window);
if (!panel) 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);
@ -144,6 +145,7 @@ void event_button_press (XEvent *e)
XSendEvent(server.dsp, e->xbutton.window, False, ButtonPressMask, e);
return;
}
}
if (e->xbutton.button != 1) return;
@ -183,12 +185,14 @@ void event_button_release (XEvent *e)
Panel *panel = get_panel(e->xany.window);
if (!panel) 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;
int x = e->xbutton.x;
@ -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++) {

BIN
src/tint2

Binary file not shown.