#define YESNO(x) ((x) ? "yes" : "no")
#define SWM_FOCUS_DEFAULT (0)
-#define SWM_FOCUS_SYNERGY (1)
-#define SWM_FOCUS_FOLLOW (2)
+#define SWM_FOCUS_FOLLOW (1)
+#define SWM_FOCUS_MANUAL (2)
#define SWM_CONF_DEFAULT (0)
#define SWM_CONF_KEYMAPPING (1)
void configurerequest(xcb_configure_request_event_t *);
void constrain_window(struct ws_win *, struct swm_region *, int);
void destroynotify(xcb_destroy_notify_event_t *);
-void do_sync(void);
void enternotify(xcb_enter_notify_event_t *);
void event_drain(uint8_t);
void event_error(xcb_generic_error_t *);
struct ws_win *find_window(xcb_window_t);
int floating_toggle_win(struct ws_win *);
void focus(struct swm_region *, union arg *);
+void focus_flush(void);
struct ws_win *focus_magic(struct ws_win *);
+void focus_win(struct ws_win *);
#ifdef SWM_DEBUG
void focusin(xcb_focus_in_event_t *);
#endif
xcb_screen_t *get_screen(int);
char *get_win_name(xcb_window_t);
uint32_t getstate(xcb_window_t);
-void grabbuttons(struct ws_win *, int);
+void grabbuttons(struct ws_win *);
void keypress(xcb_key_press_event_t *);
#ifdef SWM_DEBUG
void leavenotify(xcb_leave_notify_event_t *);
#endif
+void load_float_geom(struct ws_win *, struct swm_region *);
void map_window_raised(xcb_window_t);
void mapnotify(xcb_map_notify_event_t *);
void mappingnotify(xcb_mapping_notify_event_t *);
}
void
-do_sync(void)
+focus_flush(void)
{
- xcb_get_input_focus_cookie_t c;
- xcb_get_input_focus_reply_t *r;
-
- /* mimic XSync() */
- c = xcb_get_input_focus(conn);
- xcb_flush(conn);
- r = xcb_get_input_focus_reply(conn, c, NULL);
- if (r)
- free(r);
+ if (focus_mode == SWM_FOCUS_DEFAULT)
+ event_drain(XCB_ENTER_NOTIFY);
+ else
+ xcb_flush(conn);
}
void
win->g = win->ws->r->g;
win->bordered = 0;
} else {
- if (win->g_floatvalid) {
- /* refloat at last floating relative position */
- win->g = win->g_float;
- X(win) += X(win->ws->r);
- Y(win) += Y(win->ws->r);
- }
+ load_float_geom(win, win->ws->r);
}
return (1);
/* clear back buffer */
gcv[0] = r->s->c[SWM_S_COLOR_BAR].pixel;
xcb_change_gc(conn, r->s->bar_gc, XCB_GC_FOREGROUND, gcv);
- xcb_poly_fill_rectangle(conn, r->bar->buffer, r->s->bar_gc,
- sizeof(rect), &rect);
+ xcb_poly_fill_rectangle(conn, r->bar->buffer, r->s->bar_gc, 1, &rect);
/* draw back buffer */
gcvd.graphics_exposures = 0;
/* clear back buffer */
gcv[0] = r->s->c[SWM_S_COLOR_BAR].pixel;
xcb_change_gc(conn, r->s->bar_gc, XCB_GC_FOREGROUND, gcv);
- xcb_poly_fill_rectangle(conn, r->bar->buffer, r->s->bar_gc,
- sizeof(rect), &rect);
+ xcb_poly_fill_rectangle(conn, r->bar->buffer, r->s->bar_gc, 1, &rect);
/* draw back buffer */
draw = XftDrawCreate(display, r->bar->buffer,
/* must be after stack */
bar_update();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
void
win->ws->focus_prev = NULL;
}
- grabbuttons(win, 0);
xcb_change_window_attributes(conn, win->id, XCB_CW_BORDER_PIXEL,
&win->ws->r->s->c[SWM_S_COLOR_UNFOCUS].pixel);
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win->s->root,
cur_focus = r->focus;
free(r);
}
- if ((cfw = find_window(cur_focus)) != NULL)
+
+ cfw = find_window(cur_focus);
+
+ if (cfw == win) {
+ if (win->ws->focus == win) {
+ DNPRINTF(SWM_D_FOCUS, "focus_win: already focused; "
+ "skipping.\n");
+ return;
+ } else {
+ DNPRINTF(SWM_D_FOCUS, "focus_win: already has input "
+ "focus.\n");
+ }
+ } else
unfocus_win(cfw);
- else {
-#if 0
- /* use larger hammer since the window was killed somehow */
- TAILQ_FOREACH(cfw, &win->ws->winlist, entry)
- if (cfw->ws && cfw->ws->r && cfw->ws->r->s)
- xcb_change_window_attributes(conn, cfw->id,
- XCB_CW_BORDER_PIXEL,
- &cfw->ws->r->s->c[SWM_S_COLOR_UNFOCUS].pixel);
-#endif
- }
win->ws->focus = win;
if (win->java == 0)
xcb_set_input_focus(conn, XCB_INPUT_FOCUS_PARENT,
win->id, XCB_CURRENT_TIME);
- grabbuttons(win, 1);
xcb_change_window_attributes(conn, win->id,
XCB_CW_BORDER_PIXEL,
&win->ws->r->s->c[SWM_S_COLOR_FOCUS].pixel);
{
xcb_generic_event_t *evt;
- xcb_flush(conn);
+ /* ensure all pending requests have been processed before filtering. */
+ xcb_aux_sync(conn);
while ((evt = xcb_poll_for_event(conn))) {
if (XCB_EVENT_RESPONSE_TYPE(evt) != rt)
event_handle(evt);
TAILQ_FOREACH(win, &old_ws->winlist, entry)
unmap_window(win);
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
DNPRINTF(SWM_D_WS, "switchws: done\n");
}
stack();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
void
a.id = SWM_ARG_ID_FOCUSCUR;
focus(r, &a);
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
void
void
store_float_geom(struct ws_win *win, struct swm_region *r)
{
+ if (win == NULL || r == NULL)
+ return;
+
/* retain window geom and region geom */
win->g_float = win->g;
win->g_float.x -= X(r);
win->g_float.w, win->g_float.h);
}
+void
+load_float_geom(struct ws_win *win, struct swm_region *r)
+{
+ if (win == NULL || r == NULL)
+ return;
+
+ if (win->g_floatvalid) {
+ win->g = win->g_float;
+ X(win) += X(r);
+ Y(win) += Y(r);
+ DNPRINTF(SWM_D_MISC, "load_float_geom: window: 0x%x, g: (%d,%d)"
+ "%d x %d\n", win->id, X(win), Y(win), WIDTH(win),
+ HEIGHT(win));
+ } else {
+ DNPRINTF(SWM_D_MISC, "load_float_geom: window: 0x%x, g_float "
+ "is not set.\n", win->id);
+ }
+}
+
void
stack_floater(struct ws_win *win, struct swm_region *r)
{
* to allow windows to change their size (e.g. mplayer fs) only retrieve
* geom on ws switches or return from max mode
*/
- if (win->g_floatvalid && (win->floatmaxed || (r != r->ws->old_r &&
- !(win->ewmh_flags & EWMH_F_FULLSCREEN)))) {
- /* refloat at last floating relative position */
- win->g = win->g_float;
- X(win) += X(r);
- Y(win) += Y(r);
+ if (win->floatmaxed || (r != r->ws->old_r &&
+ !(win->ewmh_flags & EWMH_F_FULLSCREEN))) {
+ /* update geometry for the new region */
+ load_float_geom(win, r);
}
win->floatmaxed = 0;
if (!win->g_floatvalid)
store_float_geom(win, win->ws->r);
- win->g = win->ws->r->g;
+ win->g = r->g;
}
/*
HEIGHT(win) = (double)HEIGHT(r) * dialog_ratio;
}
- if (!win->manual) {
+ if (!win->manual && !(win->ewmh_flags & EWMH_F_FULLSCREEN) &&
+ !(win->quirks & SWM_Q_ANYWHERE)) {
/*
- * floaters and transients are auto-centred unless moved
- * or resized
+ * floaters and transients are auto-centred unless moved,
+ * resized or ANYWHERE quirk is set.
*/
X(win) = X(r) + (WIDTH(r) - WIDTH(win)) / 2 - BORDER(win);
Y(win) = Y(r) + (HEIGHT(r) - HEIGHT(win)) / 2 - BORDER(win);
+
+ store_float_geom(win, r);
}
/* keep window within region bounds */
stack();
bar_update();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
void
if (r->ws->always_raise == 0)
stack();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
void
a.id = SWM_ARG_ID_FOCUSCUR;
focus(r, &a);
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
char *
}
win->floating = 0;
} else {
- if (win->g_floatvalid) {
- /* refloat at last floating relative position */
- X(win) = win->g_float.x + X(r);
- Y(win) = win->g_float.y + Y(r);
- WIDTH(win) = win->g_float.w;
- HEIGHT(win) = win->g_float.h;
- }
+ load_float_geom(win, r);
win->floating = 1;
}
if (win == NULL)
return;
+ if (win->ewmh_flags & EWMH_F_FULLSCREEN)
+ return;
+
ewmh_update_win_state(win, ewmh[_NET_WM_STATE_ABOVE].atom,
_NET_WM_STATE_TOGGLE);
focus(win->ws->r, &a);
}
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
void
stack();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
switch (args->id) {
case SWM_ARG_ID_WIDTHSHRINK:
/* not free, don't sync more than 120 times / second */
if ((mne->time - timestamp) > (1000 / 120) ) {
timestamp = mne->time;
- do_sync();
update_window(win);
+ xcb_flush(conn);
}
break;
default:
free(evt);
}
if (timestamp) {
- do_sync();
update_window(win);
+ xcb_flush(conn);
}
store_float_geom(win,r);
stack();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
move_step = 0;
switch (args->id) {
/* not free, don't sync more than 120 times / second */
if ((mne->time - timestamp) > (1000 / 120) ) {
timestamp = mne->time;
- do_sync();
update_window(win);
+ xcb_flush(conn);
}
break;
default:
free(evt);
}
if (timestamp) {
- do_sync();
update_window(win);
+ xcb_flush(conn);
}
store_float_geom(win, r);
free(qpr);
}
void
-grabbuttons(struct ws_win *win, int focused)
+grabbuttons(struct ws_win *win)
{
int i;
xcb_ungrab_button(conn, XCB_BUTTON_INDEX_ANY, win->id,
XCB_BUTTON_MASK_ANY);
- if (focused) {
- for (i = 0; i < LENGTH(buttons); i++)
- if (buttons[i].action == client_click)
- xcb_grab_button(conn, 0, win->id,
- BUTTONMASK,
- XCB_GRAB_MODE_ASYNC,
- XCB_GRAB_MODE_SYNC,
- XCB_WINDOW_NONE,
- XCB_CURSOR_NONE,
- buttons[i].button,
- buttons[i].mask);
- } else
- xcb_grab_button(conn, 0, win->id, BUTTONMASK,
- XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_SYNC, XCB_WINDOW_NONE,
- XCB_CURSOR_NONE, XCB_BUTTON_INDEX_ANY, XCB_BUTTON_MASK_ANY);
+
+ for (i = 0; i < LENGTH(buttons); i++)
+ if (buttons[i].action == client_click)
+ xcb_grab_button(conn, 0, win->id, BUTTONMASK,
+ XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
+ XCB_WINDOW_NONE, XCB_CURSOR_NONE,
+ buttons[i].button, buttons[i].mask);
}
const char *quirkname[] = {
focus_mode = SWM_FOCUS_DEFAULT;
else if (!strcmp(value, "follow_cursor"))
focus_mode = SWM_FOCUS_FOLLOW;
- else if (!strcmp(value, "synergy"))
- focus_mode = SWM_FOCUS_SYNERGY;
+ else if (!strcmp(value, "manual"))
+ focus_mode = SWM_FOCUS_MANUAL;
else
errx(1, "focus_mode");
break;
}
}
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
return (0);
}
X(win) = win->wa->x + win->wa->border_width;
Y(win) = win->wa->y + win->wa->border_width;
win->bordered = 0;
- win->g_floatvalid = 0;
win->floatmaxed = 0;
win->ewmh_flags = 0;
win->s = r->s; /* this never changes */
+ store_float_geom(win, r);
+
/* Get WM_SIZE_HINTS. */
xcb_icccm_get_wm_normal_hints_reply(conn,
xcb_icccm_get_wm_normal_hints(conn, win->id),
/* java is retarded so treat it special */
if (strstr(win->ch.instance_name, "sun-awt")) {
+ DNPRINTF(SWM_D_CLASS, "manage_window: java window "
+ "detected.\n");
win->java = 1;
border_me = 1;
}
fake_keypress(win, XK_KP_Add, XCB_MOD_MASK_SHIFT);
}
- /* Make sure window is positioned inside its region, if its active. */
- if (win->ws->r)
- constrain_window(win, win->ws->r, 0);
-
if (border_me) {
win->bordered = 1;
X(win) -= border_width;
Y(win) -= border_width;
}
+ /* Make sure window is positioned inside its region, if its active. */
+ if (win->ws->r)
+ constrain_window(win, win->ws->r, 0);
+
if (win->ws->r || border_me)
update_window(win);
event_mask |= XCB_EVENT_MASK_LEAVE_WINDOW;
#endif
- xcb_change_window_attributes(conn, id, XCB_CW_EVENT_MASK, &event_mask);
+ xcb_change_window_attributes(conn, win->id, XCB_CW_EVENT_MASK,
+ &event_mask);
out:
/* Figure out where to stack the window in the workspace. */
/* Set initial _NET_WM_ALLOWED_ACTIONS */
ewmh_update_actions(win);
+ grabbuttons(win);
+
DNPRINTF(SWM_D_MISC, "manage_window: done. window: 0x%x, (x,y) w x h: "
"(%d,%d) %d x %d, ws: %d, iconic: %s, transient: 0x%x\n", win->id,
X(win), Y(win), WIDTH(win), HEIGHT(win), win->ws->idx,
{
struct ws_win *win;
int i;
- unsigned int action;
+ int handled = 0;
DNPRINTF(SWM_D_EVENT, "buttonpress: window 0x%x, detail: %u\n",
e->event, e->detail);
return;
focus_win(focus_magic(win));
- action = client_click;
for (i = 0; i < LENGTH(buttons); i++)
- if (action == buttons[i].action && buttons[i].func &&
+ if (client_click == buttons[i].action && buttons[i].func &&
buttons[i].button == e->detail &&
- CLEANMASK(buttons[i].mask) == CLEANMASK(e->state))
+ CLEANMASK(buttons[i].mask) == CLEANMASK(e->state)) {
buttons[i].func(win, &buttons[i].args);
+ handled = 1;
+ }
+
+ if (!handled) {
+ DNPRINTF(SWM_D_EVENT, "buttonpress: passing to window\n");
+ xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, e->time);
+ }
xcb_flush(conn);
}
}
#endif
+#ifdef SWM_DEBUG
+char *
+get_stack_mode_name(uint8_t mode)
+{
+ char *name;
+
+ switch(mode) {
+ case XCB_STACK_MODE_ABOVE:
+ name = "Above";
+ break;
+ case XCB_STACK_MODE_BELOW:
+ name = "Below";
+ break;
+ case XCB_STACK_MODE_TOP_IF:
+ name = "TopIf";
+ break;
+ case XCB_STACK_MODE_BOTTOM_IF:
+ name = "BottomIf";
+ break;
+ case XCB_STACK_MODE_OPPOSITE:
+ name = "Opposite";
+ break;
+ default:
+ name = "Unknown";
+ }
+
+ return name;
+}
+#endif
+
void
configurerequest(xcb_configure_request_event_t *e)
{
struct ws_win *win;
+ struct swm_region *r = NULL;
int new = 0, i = 0;
uint16_t mask = 0;
uint32_t wc[7] = {0};
if ((win = find_window(e->window)) == NULL)
if ((win = find_unmanaged_window(e->window)) == NULL)
new = 1;
+
#ifdef SWM_DEBUG
- print_win_geom(e->window);
+ if (swm_debug & SWM_D_EVENT) {
+ print_win_geom(e->window);
+
+ DNPRINTF(SWM_D_EVENT, "configurerequest: window: 0x%x, "
+ "parent: 0x%x, new: %s, value_mask: %u { ", e->window,
+ e->parent, YESNO(new), e->value_mask);
+ if (e->value_mask & XCB_CONFIG_WINDOW_X)
+ DPRINTF("X: %d ", e->x);
+ if (e->value_mask & XCB_CONFIG_WINDOW_Y)
+ DPRINTF("Y: %d ", e->y);
+ if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH)
+ DPRINTF("W: %u ", e->width);
+ if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
+ DPRINTF("H: %u ", e->height);
+ if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH)
+ DPRINTF("Border: %u ", e->border_width);
+ if (e->value_mask & XCB_CONFIG_WINDOW_SIBLING)
+ DPRINTF("Sibling: 0x%x ", e->sibling);
+ if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE)
+ DPRINTF("StackMode: %s(%u) ",
+ get_stack_mode_name(e->stack_mode), e->stack_mode);
+ DPRINTF("}\n");
+ }
#endif
+
if (new) {
- DNPRINTF(SWM_D_EVENT, "configurerequest: new window: 0x%x, "
- "value_mask: 0x%x", e->window, e->value_mask);
if (e->value_mask & XCB_CONFIG_WINDOW_X) {
mask |= XCB_CONFIG_WINDOW_X;
wc[i++] = e->x;
- DPRINTF(", X: %d", e->x);
}
if (e->value_mask & XCB_CONFIG_WINDOW_Y) {
mask |= XCB_CONFIG_WINDOW_Y;
wc[i++] = e->y;
- DPRINTF(", Y: %d", e->y);
}
if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
mask |= XCB_CONFIG_WINDOW_WIDTH;
wc[i++] = e->width;
- DPRINTF(", W: %u", e->width);
}
if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
mask |= XCB_CONFIG_WINDOW_HEIGHT;
wc[i++] = e->height;
- DPRINTF(", H: %u", e->height);
}
if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) {
mask |= XCB_CONFIG_WINDOW_BORDER_WIDTH;
wc[i++] = e->border_width;
- DPRINTF(", Border: %u", e->border_width);
}
if (e->value_mask & XCB_CONFIG_WINDOW_SIBLING) {
mask |= XCB_CONFIG_WINDOW_SIBLING;
wc[i++] = e->sibling;
- DPRINTF(", Sibling: 0x%x", e->sibling);
}
if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) {
mask |= XCB_CONFIG_WINDOW_STACK_MODE;
wc[i++] = e->stack_mode;
- DPRINTF(", StackMode: %u", e->stack_mode);
}
if (mask != 0)
xcb_configure_window(conn, e->window, mask, wc);
-
- DPRINTF(", Sent: %s\n", YESNO((mask != 0)));
} else if ((!win->manual || win->quirks & SWM_Q_ANYWHERE) &&
!(win->ewmh_flags & EWMH_F_FULLSCREEN)) {
- win->g_float.x = e->x;
- win->g_float.y = e->y;
- if (win->ws->r) {
- win->g_float.x -= X(win->ws->r);
- win->g_float.y -= Y(win->ws->r);
- } else if (win->ws->old_r) {
- win->g_float.x -= X(win->ws->old_r);
- win->g_float.y -= Y(win->ws->old_r);
+ if (win->ws->r)
+ r = win->ws->r;
+ else if (win->ws->old_r)
+ r = win->ws->old_r;
+
+ /* windows are centered unless ANYWHERE quirk is set. */
+ if (win->quirks & SWM_Q_ANYWHERE) {
+ if (e->value_mask & XCB_CONFIG_WINDOW_X) {
+ win->g_float.x = e->x;
+ if (r)
+ win->g_float.x -= X(r);
+ }
+
+ if (e->value_mask & XCB_CONFIG_WINDOW_Y) {
+ win->g_float.y = e->y;
+ if (r)
+ win->g_float.y -= Y(r);
+ }
}
- win->g_float.w = e->width;
- win->g_float.h = e->height;
+ if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH)
+ win->g_float.w = e->width;
+
+ if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
+ win->g_float.h = e->height;
+
win->g_floatvalid = 1;
- if (win->floating) {
- win->g.x = e->x;
- win->g.y = e->y;
- win->g.w = e->width;
- win->g.h = e->height;
- update_window(win);
+ if (win->floating && r) {
+ WIDTH(win) = win->g_float.w;
+ HEIGHT(win) = win->g_float.h;
+
+ stack_floater(win, win->ws->r);
+
+ focus_flush();
} else {
config_win(win, e);
+ xcb_flush(conn);
}
} else {
config_win(win, e);
+ xcb_flush(conn);
}
-
- xcb_flush(conn);
}
void
stack();
- if (focus_mode == SWM_FOCUS_DEFAULT)
- event_drain(XCB_ENTER_NOTIFY);
- else
- xcb_flush(conn);
+ focus_flush();
}
#ifdef SWM_DEBUG
enternotify(xcb_enter_notify_event_t *e)
{
struct ws_win *win;
+
DNPRINTF(SWM_D_FOCUS, "enternotify: window: 0x%x, mode: %s(%d), "
"detail: %s(%d), root: 0x%x, subwindow: 0x%x, same_screen_focus: "
"%s, state: %d\n", e->event, get_notify_mode_label(e->mode),
e->mode, get_notify_detail_label(e->detail), e->detail, e->root,
e->child, YESNO(e->same_screen_focus), e->state);
-#if 0
- if (e->mode != XCB_NOTIFY_MODE_NORMAL) {
- DNPRINTF(SWM_D_EVENT, "skip enternotify: generated by "
- "cursor grab.\n");
+ if (focus_mode == SWM_FOCUS_MANUAL &&
+ e->mode == XCB_NOTIFY_MODE_NORMAL) {
+ DNPRINTF(SWM_D_EVENT, "enternotify: manual focus; ignoring.\n");
return;
}
-#endif
-
- switch (focus_mode) {
- case SWM_FOCUS_DEFAULT:
- break;
- case SWM_FOCUS_FOLLOW:
- break;
- case SWM_FOCUS_SYNERGY:
- break;
- }
if ((win = find_window(e->event)) == NULL) {
- DNPRINTF(SWM_D_EVENT, "skip enternotify: window is NULL\n");
+ DNPRINTF(SWM_D_EVENT, "enternotify: window is NULL; ignoring\n");
return;
}
int i, num_screens;
xcb_atom_t netwmcheck;
xcb_window_t root, win;
- uint32_t wa[2];
/* work around sun jdk bugs, code from wmname */
netwmcheck = get_atom_from_string("_NET_SUPPORTING_WM_CHECK");
root = screens[i].root;
win = xcb_generate_id(conn);
- wa[0] = screens[i].c[SWM_S_COLOR_UNFOCUS].pixel;
- wa[1] = screens[i].c[SWM_S_COLOR_UNFOCUS].pixel;
- xcb_create_window(conn, XCB_COPY_FROM_PARENT, win, 0, 0, 0, 1,
- 1, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT,
- XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL, wa);
+ xcb_create_window(conn, XCB_COPY_FROM_PARENT, win, root,
+ 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ XCB_COPY_FROM_PARENT, 0, NULL);
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
netwmcheck, XCB_ATOM_WINDOW, 32, 1, &win);