{
XEvent ev;
Time time = 0;
- struct swm_region *r = win->ws->r;
+ struct swm_region *r = NULL;
int relx, rely;
int resize_step = 0;
+ if (win == NULL)
+ return;
+ r = win->ws->r;
DNPRINTF(SWM_D_MOUSE, "resize: win %lu floating %d trans %lu\n",
win->id, win->floating, win->transient);
{
struct ws_win *win = NULL;
- if (r && r->ws)
+ if (r && r->ws && r->ws->focus)
win = r->ws->focus;
else
return;
XEvent ev;
Time time = 0;
int move_step = 0;
- struct swm_region *r = win->ws->r;
+ struct swm_region *r = NULL;
+
+ if (win == NULL)
+ return;
+ r = win->ws->r;
DNPRINTF(SWM_D_MOUSE, "move: win %lu floating %d trans %lu\n",
win->id, win->floating, win->transient);
{
struct ws_win *win = NULL;
- if (r && r->ws)
+ if (r && r->ws && r->ws->focus)
win = r->ws->focus;
else
return;
int
setlayout(char *selector, char *value, int flags)
{
- int ws_id, st, i, x, mg, ma, si, raise;
+ int ws_id, i, x, mg, ma, si, raise;
+ int st = SWM_V_STACK;
char s[1024];
struct workspace *ws;
keypress(XEvent *e)
{
unsigned int i;
- KeySym keysym, skeysym;
+ KeySym keysym;
XKeyEvent *ev = &e->xkey;
DNPRINTF(SWM_D_EVENT, "keypress: window: %lu\n", ev->window);
keysym = XKeycodeToKeysym(display, (KeyCode)ev->keycode, 0);
- skeysym = XKeycodeToKeysym(display, (KeyCode)ev->keycode, 1);
for (i = 0; i < keys_length; i++)
- if ((keysym == keys[i].keysym || skeysym == keys[i].keysym)
+ if (keysym == keys[i].keysym
&& CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
&& keyfuncs[keys[i].funcid].func) {
if (keys[i].funcid == kf_spawn_custom)
DNPRINTF(SWM_D_EVENT, "buttonpress: window: %lu\n", ev->window);
- action = root_click;
if ((win = find_window(ev->window)) == NULL)
return;