aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-12-08 18:21:31 +0100
committerdec05eba <dec05eba@protonmail.com>2023-12-08 18:21:31 +0100
commit5476474c1ceb86814676750de59b2838fd83230f (patch)
tree847c7cb4cde8ef37ea55d28ba0c5344913041f81
parent15f5c9a1433bccf8a85a12713079c0aad0650dfa (diff)
Make dialog window a real dialog window
m---------depends/mglpp0
-rw-r--r--src/QuickMedia.cpp12
2 files changed, 10 insertions, 2 deletions
diff --git a/depends/mglpp b/depends/mglpp
-Subproject 89ca6494e61ccca06a410db71458c53859cd492
+Subproject 8070b486e5951dc8f2284696c359fce791e69fb
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index edf7851..a7bea3c 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -702,8 +702,9 @@ namespace QuickMedia {
mgl::vec2i monitor_size;
mgl::vec2i focused_monitor_center = get_focused_monitor_center(disp, monitor_size);
+ const bool is_download = strcmp(plugin_name, "download") == 0;
- if(strcmp(plugin_name, "download") == 0) {
+ if(is_download) {
window_size.x = std::min(900, monitor_size.x - 100);
window_size.y = std::min(900, monitor_size.y - 100);
} else {
@@ -714,13 +715,15 @@ namespace QuickMedia {
mgl::Window::CreateParams window_create_params;
window_create_params.position = { focused_monitor_center.x - window_size.x / 2, focused_monitor_center.y - window_size.y / 2 };
window_create_params.size = window_size;
- if(strcmp(plugin_name, "download") == 0) {
+ if(is_download) {
window_create_params.min_size = window_size;
window_create_params.max_size = window_size;
}
window_create_params.hidden = no_dialog;
window_create_params.parent_window = parent_window;
window_create_params.background_color = get_theme().background_color;
+ window_create_params.class_name = "quickmedia";
+ window_create_params.window_type = is_download ? MGL_WINDOW_TYPE_DIALOG : MGL_WINDOW_TYPE_NORMAL;
if(!window.create("QuickMedia", std::move(window_create_params))) {
show_notification("QuickMedia", "Failed to create opengl window", Urgency::CRITICAL);
abort();
@@ -728,6 +731,11 @@ namespace QuickMedia {
window.set_low_latency(get_config().low_latency_mode);
+ if(is_download) {
+ XSetInputFocus(disp, window.get_system_handle(), RevertToParent, CurrentTime);
+ XFlush(disp);
+ }
+
if(!program_path.empty() && program_path.back() != '/')
program_path += '/';