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 2009-06-06
- fixed issue 90 and issue 81 : window manager's menu in panel padding - fixed issue 90 and issue 81 : window manager's menu in panel padding
works on openbox and pekwm. doesn't work on xfce, windowmaker ? 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))); list_back = g_slist_append(0, calloc(1, sizeof(Area)));
panel_config = calloc(1, sizeof(Panel)); 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.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config->area.pix.border, &a->pix.border, sizeof(Border)); memcpy(&panel_config->area.pix.border, &a->pix.border, sizeof(Border));
} }
else if (strcmp (key, "wm_menu") == 0)
wm_menu = atoi (value);
/* Battery */ /* Battery */
else if (strcmp (key, "battery") == 0) { else if (strcmp (key, "battery") == 0) {

View file

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

View file

@ -34,6 +34,7 @@ extern int mouse_scroll_down;
//panel mode //panel mode
enum { SINGLE_DESKTOP=0, MULTI_DESKTOP, SINGLE_MONITOR }; enum { SINGLE_DESKTOP=0, MULTI_DESKTOP, SINGLE_MONITOR };
extern int panel_mode; extern int panel_mode;
extern int wm_menu;
//panel position //panel position
enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 }; enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };

View file

@ -136,13 +136,15 @@ void event_button_press (XEvent *e)
Panel *panel = get_panel(e->xany.window); Panel *panel = get_panel(e->xany.window);
if (!panel) return; 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)) { if (wm_menu) {
// forward the click to the desktop window (thanks conky) 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)) {
XUngrabPointer(server.dsp, e->xbutton.time); // forward the click to the desktop window (thanks conky)
e->xbutton.window = server.root_win; XUngrabPointer(server.dsp, e->xbutton.time);
XSetInputFocus(server.dsp, e->xbutton.window, RevertToParent, e->xbutton.time); e->xbutton.window = server.root_win;
XSendEvent(server.dsp, e->xbutton.window, False, ButtonPressMask, e); XSetInputFocus(server.dsp, e->xbutton.window, RevertToParent, e->xbutton.time);
return; XSendEvent(server.dsp, e->xbutton.window, False, ButtonPressMask, e);
return;
}
} }
if (e->xbutton.button != 1) return; if (e->xbutton.button != 1) return;
@ -183,11 +185,13 @@ void event_button_release (XEvent *e)
Panel *panel = get_panel(e->xany.window); Panel *panel = get_panel(e->xany.window);
if (!panel) return; 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)) { if (wm_menu) {
// forward the click to the desktop window (thanks conky) 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)) {
e->xbutton.window = server.root_win; // forward the click to the desktop window (thanks conky)
XSendEvent(server.dsp, e->xbutton.window, False, ButtonReleaseMask, e); e->xbutton.window = server.root_win;
return; XSendEvent(server.dsp, e->xbutton.window, False, ButtonReleaseMask, e);
return;
}
} }
int action = TOGGLE_ICONIFY; int action = TOGGLE_ICONIFY;
@ -298,11 +302,13 @@ void event_property_notify (XEvent *e)
} }
// Window list // Window list
else if (at == server.atom._NET_CLIENT_LIST) { else if (at == server.atom._NET_CLIENT_LIST) {
//printf("Window list\n");
task_refresh_tasklist(); task_refresh_tasklist();
panel_refresh = 1; panel_refresh = 1;
} }
// Change active // Change active
else if (at == server.atom._NET_ACTIVE_WINDOW) { else if (at == server.atom._NET_ACTIVE_WINDOW) {
//printf("Change active\n");
GSList *l0; GSList *l0;
if (task_active) { if (task_active) {
for (i=0 ; i < nb_panel ; i++) { for (i=0 ; i < nb_panel ; i++) {

BIN
src/tint2

Binary file not shown.