Shuffle around some window event configuration code (no functional changes).

SVN revision: 9710
This commit is contained in:
Kim Woelders 2004-04-12 13:57:43 +00:00
parent 680ccb19ad
commit 024d20eca2
4 changed files with 139 additions and 110 deletions

View File

@ -1747,6 +1747,8 @@ void EwinChange(EWin * ewin, unsigned int flag);
void EwinChangesStart(EWin * ewin);
void EwinChangesProcess(EWin * ewin);
void EwinsEventsConfigure(int mode);
int BordersEventExpose(XEvent * ev);
int BordersEventMouseDown(XEvent * ev);
int BordersEventMouseUp(XEvent * ev);
@ -1871,6 +1873,7 @@ void DesktopAddEwinToTop(EWin * ewin);
void MoveEwinToDesktopAt(EWin * ewin, int num, int x, int y);
void GotoDesktopByEwin(EWin * ewin);
void FloatEwinAboveDesktops(EWin * ewin);
void DesktopsEventsConfigure(int mode);
/* dialog.c */
Dialog *DialogCreate(const char *name);

View File

@ -3167,6 +3167,115 @@ EwinChangesProcess(EWin * ewin)
EWinChanges.flags = 0;
}
static void
EwinEventsConfigure(EWin * ewin, int mode)
{
int i;
if (mode)
{
XSelectInput(disp, ewin->win,
SubstructureNotifyMask | SubstructureRedirectMask |
PropertyChangeMask | ResizeRedirectMask);
if (ewin->pager)
{
#if 0 /* ??? */
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ButtonPressMask |
ButtonReleaseMask | PointerMotionMask);
#endif
}
else if (ewin->dialog)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ExposureMask | KeyPressMask);
else
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask);
for (i = 0; i < ewin->border->num_winparts; i++)
{
if (ewin->border->part[i].flags & FLAG_TITLE)
XSelectInput(disp, ewin->bits[i].win,
ExposureMask | ButtonPressMask |
ButtonReleaseMask);
else
XSelectInput(disp, ewin->bits[i].win,
ButtonPressMask | ButtonReleaseMask);
}
}
else
{
XSelectInput(disp, ewin->win,
SubstructureNotifyMask | SubstructureRedirectMask |
EnterWindowMask | LeaveWindowMask | PointerMotionMask
| PropertyChangeMask | ResizeRedirectMask |
ButtonPressMask | ButtonReleaseMask);
if (ewin->pager)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ButtonPressMask |
ButtonReleaseMask | PointerMotionMask);
else if (ewin->dialog)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ExposureMask | KeyPressMask);
else
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask);
for (i = 0; i < ewin->border->num_winparts; i++)
{
if (ewin->border->part[i].flags & FLAG_TITLE)
XSelectInput(disp, ewin->bits[i].win,
ExposureMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask |
PointerMotionMask);
else
XSelectInput(disp, ewin->bits[i].win,
KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask |
PointerMotionMask);
}
}
}
void
EwinsEventsConfigure(int mode)
{
EWin *const *lst, *ewin;
int i, num;
lst = EwinListGetAll(&num);
for (i = 0; i < num; i++)
{
ewin = lst[i];
EwinEventsConfigure(lst[i], mode);
/* This is a hack. Maybe we should do something with expose events. */
if (mode == 0)
if (Mode.mode == MODE_DESKSWITCH && ewin->sticky && ewin->visible)
EwinRefresh(ewin);
}
}
/*
* Border event handlers
*/

View File

@ -1281,3 +1281,25 @@ FloatEwinAboveDesktops(EWin * ewin)
EDBUG_RETURN_;
}
#endif
void
DesktopsEventsConfigure(int mode)
{
int i;
long event_mask;
if (mode)
event_mask =
PropertyChangeMask | SubstructureRedirectMask |
ButtonPressMask | ButtonReleaseMask;
else
event_mask =
SubstructureNotifyMask | ButtonPressMask |
ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
ButtonMotionMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask | KeyReleaseMask
| PointerMotionMask;
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
XSelectInput(disp, desks.desk[i].win, event_mask);
}

View File

@ -336,9 +336,6 @@ FocusToEWin(EWin * ewin, int why)
void
FocusNewDeskBegin(void)
{
EWin *const *lst, *ewin;
int i, j, num;
if (new_desk_focus_nesting++)
return;
@ -346,60 +343,14 @@ FocusNewDeskBegin(void)
/* we are about to flip desktops or areas - disable enter and leave events
* temporarily */
lst = EwinListGetAll(&num);
for (i = 0; i < num; i++)
{
ewin = lst[i];
XSelectInput(disp, ewin->win,
SubstructureNotifyMask | SubstructureRedirectMask |
PropertyChangeMask | ResizeRedirectMask);
if (ewin->pager)
{
#if 0 /* ??? */
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ButtonPressMask |
ButtonReleaseMask | PointerMotionMask);
#endif
}
else if (ewin->dialog)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ExposureMask | KeyPressMask);
else
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask);
for (j = 0; j < ewin->border->num_winparts; j++)
{
if (ewin->border->part[j].flags & FLAG_TITLE)
XSelectInput(disp, ewin->bits[j].win,
ExposureMask | ButtonPressMask |
ButtonReleaseMask);
else
XSelectInput(disp, ewin->bits[j].win,
ButtonPressMask | ButtonReleaseMask);
}
}
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
XSelectInput(disp, desks.desk[i].win,
PropertyChangeMask | SubstructureRedirectMask |
ButtonPressMask | ButtonReleaseMask);
EwinsEventsConfigure(1);
DesktopsEventsConfigure(1);
}
void
FocusNewDesk(void)
{
EWin *const *lst, *ewin;
int i, j, num;
EWin *ewin;
EDBUG(4, "FocusNewDesk");
@ -407,64 +358,8 @@ FocusNewDesk(void)
return;
/* we flipped - re-enable enter and leave events */
lst = EwinListGetAll(&num);
for (i = 0; i < num; i++)
{
ewin = lst[i];
XSelectInput(disp, ewin->win,
SubstructureNotifyMask | SubstructureRedirectMask |
EnterWindowMask | LeaveWindowMask | PointerMotionMask |
PropertyChangeMask | ResizeRedirectMask |
ButtonPressMask | ButtonReleaseMask);
if (ewin->pager)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ButtonPressMask |
ButtonReleaseMask | PointerMotionMask);
else if (ewin->dialog)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask | ExposureMask | KeyPressMask);
else
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask);
for (j = 0; j < ewin->border->num_winparts; j++)
{
if (ewin->border->part[j].flags & FLAG_TITLE)
XSelectInput(disp, ewin->bits[j].win,
ExposureMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask |
PointerMotionMask);
else
XSelectInput(disp, ewin->bits[j].win,
KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask |
PointerMotionMask);
}
if (Mode.mode == MODE_DESKSWITCH && ewin->sticky && ewin->visible)
EwinRefresh(ewin);
}
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
XSelectInput(disp, desks.desk[i].win,
SubstructureNotifyMask | ButtonPressMask |
ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
ButtonMotionMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
PointerMotionMask);
EwinsEventsConfigure(0);
DesktopsEventsConfigure(0);
/* Set the mouse-over window */
ewin = GetEwinByCurrentPointer();