fixed issue 90 and issue 81 : window manager s menu in panel padding
git-svn-id: http://tint2.googlecode.com/svn/trunk@87 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
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 ?
|
||||||
|
tint2 send mouse event to your window manager on left/right padding
|
||||||
|
and on top/bottom panel padding.
|
||||||
|
|
||||||
2009-06-05
|
2009-06-05
|
||||||
- fixed issue 46 and 59 : urgent task
|
- fixed issue 46 and 59 : urgent task
|
||||||
limitation : just one urgent task at a time
|
limitation : just one urgent task at a time
|
||||||
|
|||||||
24
src/tint.c
24
src/tint.c
@@ -136,6 +136,17 @@ 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)) {
|
||||||
|
// 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;
|
||||||
|
|
||||||
if (panel_mode != MULTI_DESKTOP) {
|
if (panel_mode != MULTI_DESKTOP) {
|
||||||
// drag and drop disabled
|
// drag and drop disabled
|
||||||
XLowerWindow (server.dsp, panel->main_win);
|
XLowerWindow (server.dsp, panel->main_win);
|
||||||
@@ -145,7 +156,6 @@ void event_button_press (XEvent *e)
|
|||||||
GSList *l0;
|
GSList *l0;
|
||||||
Taskbar *tskbar;
|
Taskbar *tskbar;
|
||||||
int x = e->xbutton.x;
|
int x = e->xbutton.x;
|
||||||
//int y = e->xbutton.y; // unused
|
|
||||||
for (l0 = panel->area.list; l0 ; l0 = l0->next) {
|
for (l0 = panel->area.list; l0 ; l0 = l0->next) {
|
||||||
tskbar = l0->data;
|
tskbar = l0->data;
|
||||||
if (!tskbar->area.on_screen) continue;
|
if (!tskbar->area.on_screen) continue;
|
||||||
@@ -170,11 +180,16 @@ void event_button_press (XEvent *e)
|
|||||||
|
|
||||||
void event_button_release (XEvent *e)
|
void event_button_release (XEvent *e)
|
||||||
{
|
{
|
||||||
// TODO: convert event_button_press(int x, int y) to area->event_button_press()
|
|
||||||
|
|
||||||
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)) {
|
||||||
|
// 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 action = TOGGLE_ICONIFY;
|
||||||
int x = e->xbutton.x;
|
int x = e->xbutton.x;
|
||||||
//int y = e->xbutton.y; // unused
|
//int y = e->xbutton.y; // unused
|
||||||
@@ -551,8 +566,7 @@ load_config:
|
|||||||
|
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
//printf("ButtonPress %lx\n", e.xproperty.window);
|
event_button_press (&e);
|
||||||
if (e.xbutton.button == 1) event_button_press (&e);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
|
|||||||
Reference in New Issue
Block a user