diff options
author | uint23 <[email protected]> | 2025-04-17 17:19:39 +0100 |
---|---|---|
committer | uint23 <[email protected]> | 2025-04-17 17:19:39 +0100 |
commit | 57477a4dd0726153e759562ec5c7969a6d0147c7 (patch) | |
tree | 4c2caab15ef7636c46d0fa3e502a723b94605f12 | |
parent | a8dce8bdcd9c2445e186253b8e5206ac1eb5bf61 (diff) |
optimisations, can resize from tiled mode
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/sxwm.c | 26 |
2 files changed, 4 insertions, 24 deletions
@@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -Wall -Wextra -O3 -g -Isrc +CFLAGS = -Wall -Wextra -O3 -g -Isrc -march=native -flto -s LDFLAGS = -lX11 SRC_DIR = src @@ -120,28 +120,7 @@ close_focused(void) if (!clients) return; - // ICCCM first ;) Window w = focused->win; - Atom *protocols; - int n; - if (XGetWMProtocols(dpy, w, &protocols, &n)) { - Atom del = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - for (int i = 0; i < n; ++i) { - if (protocols[i] == del) { - XEvent ev = { 0 }; - ev.xclient.type = ClientMessage; - ev.xclient.window = w; - ev.xclient.message_type = XInternAtom(dpy, "WM_PROTOCOLS", False); - ev.xclient.format = 32; - ev.xclient.data.l[0] = del; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, w, False, NoEventMask, &ev); - XFree(protocols); - return; - } - } - XFree(protocols); - } XKillClient(dpy, w); } @@ -221,7 +200,8 @@ hdl_button(XEvent *xev) if (c->win != w) continue; - if ((e->state & MOD) && e->button == Button1 && !c->floating) { + if (((e->state & MOD) && e->button == Button1 && !c->floating) || + ((e->state & MOD) && e->button == Button3 && !c->floating)) { focused = c; toggle_floating(); } @@ -485,6 +465,7 @@ setup(void) XGrabButton(dpy, Button3, MOD, root, True, ButtonPressMask|ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None); + XSync(dpy, False); for (int i = 0; i < LASTEvent; ++i) evtable[i] = hdl_dummy; @@ -631,7 +612,6 @@ update_borders(void) XSetWindowBorder(dpy, c->win, (c == focused ? border_foc_col : border_ufoc_col)); } - XSync(dpy, False); } static int |