#define SWM_Q_TRANSSZ (1<<1) /* transiend window size too small */
#define SWM_Q_ANYWHERE (1<<2) /* don't position this window */
#define SWM_Q_XTERM_FONTADJ (1<<3) /* adjust xterm fonts when resizing */
-#define SWM_Q_FULLSCREEN (1<<4) /* remove border */
+#define SWM_Q_FULLSCREEN (1<<4) /* remove border when fullscreen */
#define SWM_Q_FOCUSPREV (1<<5) /* focus on caller */
#define SWM_Q_NOFOCUSONMAP (1<<6) /* Don't focus on window when mapped. */
#define SWM_Q_FOCUSONMAP_SINGLE (1<<7) /* Only focus if single win of type. */
#define SWM_Q_IGNOREPID (1<<9) /* Ignore PID when determining ws. */
#define SWM_Q_IGNORESPAWNWS (1<<10) /* Ignore _SWM_WS when managing win. */
#define SWM_Q_NOFOCUSCYCLE (1<<11) /* Remove from normal focus cycle. */
+#define SWM_Q_MINIMALBORDER (1<<12) /* Remove border when floating/unfocused */
};
TAILQ_HEAD(quirk_list, quirk);
struct quirk_list quirks = TAILQ_HEAD_INITIALIZER(quirks);
void check_conn(void);
void clear_keys(void);
int clear_maximized(struct workspace *);
+void clear_quirks(void);
+void clear_spawns(void);
void clientmessage(xcb_client_message_event_t *);
void client_msg(struct ws_win *, xcb_atom_t, xcb_timestamp_t);
int conf_load(const char *, int);
#endif
void propertynotify(xcb_property_notify_event_t *);
void quirk_free(struct quirk *);
-void clear_quirks(void);
void quirk_insert(const char *, const char *, const char *, uint32_t, int);
void quirk_remove(struct quirk *);
void quirk_replace(struct quirk *, const char *, const char *, const char *,
void spawn_insert(const char *, const char *, int);
struct spawn_prog *spawn_find(const char *);
void spawn_remove(struct spawn_prog *);
-void clear_spawns(void);
void spawn_replace(struct spawn_prog *, const char *, const char *, int);
void spawn_select(struct swm_region *, union arg *, const char *, int *);
void stack_config(struct swm_region *, union arg *);
if (win->ws->always_raise)
raise_window(win);
+ /* Update border width */
+ if (win->bordered && (win->quirks & SWM_Q_MINIMALBORDER) &&
+ FLOATING(win)) {
+ win->bordered = 0;
+ X(win) += border_width;
+ Y(win) += border_width;
+ update_window(win);
+ }
+
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win->s->root,
ewmh[_NET_ACTIVE_WINDOW].atom, XCB_ATOM_WINDOW, 32, 1, &none);
&win->id);
}
- if (cfw != win)
+ if (cfw != win) {
/* Update window border even if workspace is hidden. */
update_window_color(win);
+ /* Update border width */
+ if (!win->bordered && WS_FOCUSED(win->ws) &&
+ (win->quirks & SWM_Q_MINIMALBORDER) && FLOATING(win)) {
+ win->bordered = 1;
+ X(win) -= border_width;
+ Y(win) -= border_width;
+ update_window(win);
+ }
+ }
+
out:
bar_draw();
if (r != ws->old_r)
load_float_geom(win);
- if ((win->quirks & SWM_Q_FULLSCREEN) &&
- WIDTH(win) >= WIDTH(r) && HEIGHT(win) >= HEIGHT(r)) {
- /* Remove border for FULLSCREEN quirk. */
+ if (((win->quirks & SWM_Q_FULLSCREEN) &&
+ WIDTH(win) >= WIDTH(r) && HEIGHT(win) >= HEIGHT(r)) ||
+ ((!WS_FOCUSED(win->ws) || win->ws->focus != win) &&
+ (win->quirks & SWM_Q_MINIMALBORDER))) {
+ /* Remove border */
win->bordered = false;
} else if (!MANUAL(win)) {
if (TRANS(win) && (win->quirks & SWM_Q_TRANSSZ)) {
"IGNOREPID",
"IGNORESPAWNWS",
"NOFOCUSCYCLE",
+ "MINIMALBORDER",
};
/* SWM_Q_DELIM: retain '|' for back compat for now (2009-08-11) */