From e099547cfa2038b9a2b09585521f7f258fc75724 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 3 Aug 2024 18:14:25 +0200 Subject: Add notification window type --- src/window/window.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/window/window.c') diff --git a/src/window/window.c b/src/window/window.c index be8aa14..6ed409a 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -76,6 +76,8 @@ typedef struct { Atom net_wm_window_type_atom; Atom net_wm_window_type_normal_atom; Atom net_wm_window_type_dialog_atom; + Atom net_wm_window_type_notification_atom; + Atom net_wm_window_type_utility; Atom motif_wm_hints_atom; Cursor default_cursor; Cursor invisible_cursor; @@ -175,6 +177,8 @@ static int x11_context_init(x11_context *self, bool alpha) { self->net_wm_window_type_atom = XInternAtom(context->connection, "_NET_WM_WINDOW_TYPE", False); self->net_wm_window_type_normal_atom = XInternAtom(context->connection, "_NET_WM_WINDOW_TYPE_NORMAL", False); self->net_wm_window_type_dialog_atom = XInternAtom(context->connection, "_NET_WM_WINDOW_TYPE_DIALOG", False); + self->net_wm_window_type_notification_atom = XInternAtom(context->connection, "_NET_WM_WINDOW_TYPE_NOTIFICATION", False); + self->net_wm_window_type_utility = XInternAtom(context->connection, "_NET_WM_WINDOW_TYPE_UTILITY", False); self->motif_wm_hints_atom = XInternAtom(context->connection, "_MOTIF_WM_HINTS", False); self->default_cursor = None; self->invisible_cursor = None; @@ -507,6 +511,15 @@ static void mgl_set_window_type(mgl_window *self, mgl_window_type window_type) { XChangeProperty(context->connection, self->window, x11_context->net_wm_state_atom, XA_ATOM, 32, PropModeReplace, (unsigned char*)&x11_context->net_wm_state_above_atom, 1L); break; } + case MGL_WINDOW_TYPE_NOTIFICATION: { + const Atom data[2] = { + self->net_wm_window_type_notification_atom; + self->net_wm_window_type_utility; + }; + XChangeProperty(context->connection, self->window, x11_context->net_wm_window_type_atom, XA_ATOM, 32, PropModeReplace, (const unsigned char*)data, 2L); + XChangeProperty(context->connection, self->window, x11_context->net_wm_state_atom, XA_ATOM, 32, PropModeReplace, (unsigned char*)&x11_context->net_wm_state_above_atom, 1L); + break; + } } } -- cgit v1.2.3