parent
05086b00f3
commit
06f9158af0
|
@ -1024,25 +1024,14 @@ BorderWinpartGetAclass(void *data)
|
|||
}
|
||||
|
||||
static void
|
||||
BorderWinpartHandleTooltip(EWinBit * wbit, int event)
|
||||
BorderWinpartHandleTooltip(EWinBit * wbit)
|
||||
{
|
||||
EWin *ewin = wbit->ewin;
|
||||
int part = wbit - ewin->bits;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case ButtonPress:
|
||||
case LeaveNotify:
|
||||
TooltipsSetPending(0, NULL, NULL);
|
||||
break;
|
||||
case ButtonRelease:
|
||||
case EnterNotify:
|
||||
case MotionNotify:
|
||||
if (!ewin->border->part[part].aclass)
|
||||
return;
|
||||
TooltipsSetPending(0, BorderWinpartGetAclass, wbit);
|
||||
break;
|
||||
}
|
||||
if (!ewin->border->part[part].aclass)
|
||||
return;
|
||||
TooltipsSetPending(0, BorderWinpartGetAclass, wbit);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1050,9 +1039,6 @@ BorderWinpartHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
{
|
||||
EWinBit *wbit = (EWinBit *) prm;
|
||||
|
||||
/* Beware! Actions may destroy the current border */
|
||||
BorderWinpartHandleTooltip(wbit, ev->type);
|
||||
|
||||
switch (ev->type)
|
||||
{
|
||||
case ButtonPress:
|
||||
|
@ -1062,11 +1048,16 @@ BorderWinpartHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
BorderWinpartEventMouseUp(wbit, ev);
|
||||
break;
|
||||
case EnterNotify:
|
||||
/* Beware! Actions may destroy the current border */
|
||||
BorderWinpartHandleTooltip(wbit);
|
||||
BorderWinpartEventEnter(wbit, ev);
|
||||
break;
|
||||
case LeaveNotify:
|
||||
BorderWinpartEventLeave(wbit, ev);
|
||||
break;
|
||||
case MotionNotify:
|
||||
BorderWinpartHandleTooltip(wbit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -634,23 +634,6 @@ ButtonGetAclass(void *data)
|
|||
return b->aclass;
|
||||
}
|
||||
|
||||
static void
|
||||
ButtonHandleTooltip(Button * b, int event)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case ButtonPress:
|
||||
case LeaveNotify:
|
||||
TooltipsSetPending(0, NULL, NULL);
|
||||
break;
|
||||
case ButtonRelease:
|
||||
case EnterNotify:
|
||||
case MotionNotify:
|
||||
TooltipsSetPending(0, ButtonGetAclass, b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ButtonHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
||||
{
|
||||
|
@ -666,6 +649,8 @@ ButtonHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
break;
|
||||
case MotionNotify:
|
||||
ButtonEventMotion(b, ev);
|
||||
if (b->aclass)
|
||||
TooltipsSetPending(0, ButtonGetAclass, b);
|
||||
break;
|
||||
case EnterNotify:
|
||||
ButtonEventMouseIn(b, ev);
|
||||
|
@ -675,9 +660,6 @@ ButtonHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
break;
|
||||
}
|
||||
|
||||
if (b->aclass)
|
||||
ButtonHandleTooltip(b, ev->type);
|
||||
|
||||
if (b->func)
|
||||
b->func(b->owner, ev, NULL);
|
||||
}
|
||||
|
|
|
@ -1173,8 +1173,6 @@ static void
|
|||
DeskSwitchStart(void)
|
||||
{
|
||||
FocusNewDeskBegin();
|
||||
|
||||
TooltipsSetPending(1, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1908,23 +1906,6 @@ DeskGetAclass(void *data __UNUSED__)
|
|||
return ActionclassFind("DESKBINDINGS");
|
||||
}
|
||||
|
||||
static void
|
||||
DeskHandleTooltip(Desk * dsk, XEvent * ev)
|
||||
{
|
||||
switch (ev->type)
|
||||
{
|
||||
case ButtonPress:
|
||||
case ButtonRelease:
|
||||
case LeaveNotify:
|
||||
TooltipsSetPending(1, NULL, NULL);
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
TooltipsSetPending(1, DeskGetAclass, dsk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DeskPropertyChange(Desk * dsk, XEvent * ev)
|
||||
{
|
||||
|
@ -1984,6 +1965,7 @@ DeskHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
case MotionNotify:
|
||||
/* Motion over desk buttons doesn't go here - We probably don't care much. */
|
||||
DesksSetCurrent(DesktopAt(Mode.events.x, Mode.events.y));
|
||||
TooltipsSetPending(1, DeskGetAclass, dsk);
|
||||
break;
|
||||
|
||||
case ConfigureNotify:
|
||||
|
@ -2006,8 +1988,6 @@ DeskHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
DeskHandleTooltip(dsk, ev);
|
||||
}
|
||||
|
||||
/* Settings */
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "events.h"
|
||||
#include "session.h"
|
||||
#include "timers.h"
|
||||
#include "tooltips.h"
|
||||
#include "xwin.h"
|
||||
#include <sys/time.h>
|
||||
#if USE_XSYNC
|
||||
|
@ -275,6 +276,7 @@ HandleEvent(XEvent * ev)
|
|||
Mode.events.time = ev->xbutton.time;
|
||||
ModeGetXY(ev->xbutton.root, ev->xbutton.x_root, ev->xbutton.y_root);
|
||||
Mode.events.on_screen = ev->xbutton.same_screen;
|
||||
TooltipsSetPending(0, NULL, NULL);
|
||||
goto do_stuff;
|
||||
|
||||
case MotionNotify:
|
||||
|
@ -296,6 +298,7 @@ HandleEvent(XEvent * ev)
|
|||
if (!Mode.grabs.pointer_grab_active)
|
||||
Mode.grabs.pointer_grab_active = 2;
|
||||
}
|
||||
TooltipsSetPending(0, NULL, NULL);
|
||||
goto do_stuff;
|
||||
|
||||
case LeaveNotify:
|
||||
|
@ -307,6 +310,7 @@ HandleEvent(XEvent * ev)
|
|||
Mode.grabs.pointer_grab_window = None;
|
||||
Mode.grabs.pointer_grab_active = 0;
|
||||
}
|
||||
TooltipsSetPending(0, NULL, NULL);
|
||||
goto do_stuff;
|
||||
|
||||
case PropertyNotify:
|
||||
|
|
|
@ -797,6 +797,9 @@ ToolTipTimeout(int val __UNUSED__, void *data __UNUSED__)
|
|||
void
|
||||
TooltipsSetPending(int type, CB_GetAclass * func, void *data)
|
||||
{
|
||||
if (!Mode_tooltips.ac_func && !func)
|
||||
return;
|
||||
|
||||
Mode_tooltips.ac_func = func;
|
||||
Mode_tooltips.ac_data = data;
|
||||
|
||||
|
|
Loading…
Reference in New Issue