From a2e9e999018f021134129b24fb941c485e6c44b6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 3 Aug 2024 18:16:42 +0200 Subject: Change window type to notification (keeps position on screen when changing workspace on dwm --- depends/mglpp | 2 +- src/main.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/depends/mglpp b/depends/mglpp index be41f20..5d5a88a 160000 --- a/depends/mglpp +++ b/depends/mglpp @@ -1 +1 @@ -Subproject commit be41f208c6660a879818321e2904795c7d45fe3e +Subproject commit 5d5a88afbc57ee72c7bbab05ee58aebd64ee3f66 diff --git a/src/main.cpp b/src/main.cpp index 8f40d39..c50149d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -205,7 +205,7 @@ int main(int argc, char **argv) { window_create_params.override_redirect = true; window_create_params.background_color = bg_color; window_create_params.hide_decorations = true; - window_create_params.window_type = MGL_WINDOW_TYPE_DIALOG; + window_create_params.window_type = MGL_WINDOW_TYPE_NOTIFICATION; mgl::Window window; if(!window.create("GPU Screen Recorder Notification", window_create_params)) @@ -250,7 +250,9 @@ int main(int argc, char **argv) { padding_between_icon_and_text_x = (int)(logo_sprite_padding_x * 0.7f); } - // TODO: Use the monitor that the cursor is on or the focused window is on + // TODO: Use the monitor that the cursor is on or the focused window is on. + // TODO: Update position when workspace changes (in dwm, sticky property handles it in real workspaces). + // TODO: Make sure the notification always stays on top. Test with starting the notification and then opening youtube in fullscreen. const int window_width = content_padding_left + logo_sprite_padding_x + logo_sprite.get_size().x + padding_between_icon_and_text_x + text.get_bounds().size.x + logo_sprite_padding_x + padding_between_icon_and_text_x; const mgl::vec2i window_size{window_width, window_height}; const mgl::vec2i window_start_position{win->monitors[0].size.x, window_size.y}; -- cgit v1.2.3