summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav <abhinav.prsai@gmail.com>2025-06-29 19:00:34 +0100
committerAbhinav <abhinav.prsai@gmail.com>2025-06-29 19:00:34 +0100
commit0065ea8d40788b4344d0fdaf9e3bc1144d06af34 (patch)
tree692b80edaa037b737d9a34772fdf43920d706762
parent4d37cc473bc8e6539f3488c1adb34b875c18cd06 (diff)
add _NET_FRAME_EXTENTS atom support
this hopefully should allow programs like WINE and who spawn windows by them selves function properly
-rw-r--r--src/sxwm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index 96ac3f0..d48523e 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -83,6 +83,7 @@ void scan_existing_windows(void);
void send_wm_take_focus(Window w);
void setup(void);
void setup_atoms(void);
+void set_frame_extents(Window w);
void set_win_scratchpad(int n);
int snap_coordinate(int pos, int size, int screen_size, int snap_dist);
void spawn(const char **argv);
@@ -123,6 +124,7 @@ Atom atom_net_wm_name;
Atom atom_utf8_string;
Atom atom_net_wm_desktop;
Atom atom_net_client_list;
+Atom atom_net_frame_extents;
Cursor c_normal, c_move, c_resize;
Client *workspaces[NUM_WORKSPACES] = {NULL};
@@ -1279,6 +1281,7 @@ void hdl_map_req(XEvent *xev)
XMapWindow(dpy, w);
c->mapped = True;
+ set_frame_extents(w);
if (user_config.new_win_focus) {
focused = c;
@@ -2057,6 +2060,7 @@ void setup_atoms(void)
atom_utf8_string = XInternAtom(dpy, "UTF8_STRING", False);
atom_net_wm_desktop = XInternAtom(dpy, "_NET_WM_DESKTOP", False);
atom_net_client_list = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
+ atom_net_frame_extents = XInternAtom(dpy, "_NET_FRAME_EXTENTS", False);
Atom support_list[] = {
atom_net_current_desktop,
@@ -2075,6 +2079,7 @@ void setup_atoms(void)
atom_utf8_string,
atom_net_wm_desktop,
atom_net_client_list,
+ atom_net_frame_extents,
};
long num = NUM_WORKSPACES;
@@ -2096,6 +2101,12 @@ void setup_atoms(void)
update_workarea();
}
+void set_frame_extents(Window w)
+{
+ long extents[4] = {user_config.border_width, user_config.border_width, user_config.border_width, user_config.border_width};
+ XChangeProperty(dpy, w, atom_net_frame_extents, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)extents, 4);
+}
+
void set_win_scratchpad(int n)
{
if (focused == NULL) {