diff options
Diffstat (limited to 'src/window_x11.c')
| -rw-r--r-- | src/window_x11.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/window_x11.c b/src/window_x11.c index 2f84f19..998beb4 100644 --- a/src/window_x11.c +++ b/src/window_x11.c @@ -180,8 +180,8 @@ static void set_decorations(struct stl_window_x11 *xw, bool enabled) } } -static bool window_x11_create_window(struct stl_window *window, u32 width, u32 height, - const char *monitor, const char *name, u32 flags) +static bool window_x11_create_window(struct stl_window *window, u32 width, u32 height, u32 flags, + const char *monitor, const char *name, const char *app_id) { struct stl_window_x11 *xw = (struct stl_window_x11 *)window; (void)monitor; @@ -201,7 +201,7 @@ static bool window_x11_create_window(struct stl_window *window, u32 width, u32 h XStoreName(global.x11_d, xw->window, name); XClassHint *class_hint = XAllocClassHint(); class_hint->res_name = (char *)name; - class_hint->res_class = (char *)name; + class_hint->res_class = (char *)app_id; XSetClassHint(global.x11_d, xw->window, class_hint); XFree(class_hint); @@ -553,14 +553,14 @@ static void handle_next_xevent(struct stl_window_x11 *xw) event.xclient.send_event = True; event.xclient.display = global.x11_d; event.xclient.window = xw->window; - // https://specifications.freedesktop.org/wm-spec/1.4/ar01s04.html#id-1.5.4 + // https://specifications.freedesktop.org/wm/1.5/ar01s04.html#id-1.5.4 event.xclient.message_type = XInternAtom(global.x11_d, "_NET_WM_MOVERESIZE", False); event.xclient.format = 32; - event.xclient.data.l[0] = xev.xbutton.x; - event.xclient.data.l[1] = xev.xbutton.y; + event.xclient.data.l[0] = xev.xbutton.x_root; + event.xclient.data.l[1] = xev.xbutton.y_root; event.xclient.data.l[2] = _NET_WM_MOVERESIZE_MOVE; - event.xclient.data.l[3] = 0; - // https://specifications.freedesktop.org/wm-spec/1.4/ar01s09.html#sourceindication + event.xclient.data.l[3] = xev.xbutton.button; + // https://specifications.freedesktop.org/wm/1.5/ar01s09.html#sourceindication event.xclient.data.l[4] = 1; // Source indication of "normal applications". Window root = DefaultRootWindow(global.x11_d); XSendEvent(global.x11_d, root, False, SubstructureRedirectMask | SubstructureNotifyMask, &event); |