mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
cvsimport
* refs/heads/master: drop obsolete comment Alter callbacks to take a struct instead of a growing number of arguments; greatly simplifies upcoming work. Ensure clients stay within the viewable bounds on placement, even with empty borders; based on a patch from Vadim Vygonets. Clean up, unify and accurately calculate edge distance with client move/resize actions, so as to not lose windows off the edge. Switch bwidth type; unfortunately X11 is inconsistent.
This commit is contained in:
15
xevents.c
15
xevents.c
@@ -215,7 +215,6 @@ xev_handle_enternotify(XEvent *ee)
|
||||
client_setactive(cc);
|
||||
}
|
||||
|
||||
/* We can split this into two event handlers. */
|
||||
static void
|
||||
xev_handle_buttonpress(XEvent *ee)
|
||||
{
|
||||
@@ -233,22 +232,23 @@ xev_handle_buttonpress(XEvent *ee)
|
||||
|
||||
if (mb == NULL)
|
||||
return;
|
||||
mb->cargs->xev = CWM_XEV_BTN;
|
||||
switch (mb->context) {
|
||||
case CWM_CONTEXT_CC:
|
||||
if (((cc = client_find(e->window)) == NULL) &&
|
||||
(cc = client_current()) == NULL)
|
||||
return;
|
||||
(*mb->callback)(cc, &mb->argument, CWM_XEV_BTN);
|
||||
(*mb->callback)(cc, mb->cargs);
|
||||
break;
|
||||
case CWM_CONTEXT_SC:
|
||||
if (e->window != e->root)
|
||||
return;
|
||||
if ((sc = screen_find(e->window)) == NULL)
|
||||
return;
|
||||
(*mb->callback)(sc, &mb->argument, CWM_XEV_BTN);
|
||||
(*mb->callback)(sc, mb->cargs);
|
||||
break;
|
||||
case CWM_CONTEXT_NONE:
|
||||
(*mb->callback)(NULL, &mb->argument, CWM_XEV_BTN);
|
||||
(*mb->callback)(NULL, mb->cargs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -295,20 +295,21 @@ xev_handle_keypress(XEvent *ee)
|
||||
|
||||
if (kb == NULL)
|
||||
return;
|
||||
kb->cargs->xev = CWM_XEV_KEY;
|
||||
switch (kb->context) {
|
||||
case CWM_CONTEXT_CC:
|
||||
if (((cc = client_find(e->window)) == NULL) &&
|
||||
(cc = client_current()) == NULL)
|
||||
return;
|
||||
(*kb->callback)(cc, &kb->argument, CWM_XEV_KEY);
|
||||
(*kb->callback)(cc, kb->cargs);
|
||||
break;
|
||||
case CWM_CONTEXT_SC:
|
||||
if ((sc = screen_find(e->window)) == NULL)
|
||||
return;
|
||||
(*kb->callback)(sc, &kb->argument, CWM_XEV_KEY);
|
||||
(*kb->callback)(sc, kb->cargs);
|
||||
break;
|
||||
case CWM_CONTEXT_NONE:
|
||||
(*kb->callback)(NULL, &kb->argument, CWM_XEV_KEY);
|
||||
(*kb->callback)(NULL, kb->cargs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user