aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-10-21 22:18:22 +0200
committerdec05eba <dec05eba@protonmail.com>2022-10-21 22:18:22 +0200
commit765a45b84eedaf27a69776b9be3852ea26e9b176 (patch)
tree237a520901b7fb1c9672bdb2d5ae85dd952c6d65 /src
parent3a3a4f2d6bf9087a6443cd9d6bb484fc6c020ffc (diff)
Make max window size slightly smaller than screen size
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index fb97ca6..4b441ec 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -169,14 +169,14 @@ static int get_largest_monitor_height(Display *display) {
});
if(max_height == 0)
- max_height = DefaultScreenOfDisplay(display)->height;
+ max_height = XHeightOfScreen(DefaultScreenOfDisplay(display));
return std::max(max_height, 240);
}
static void get_screen_resolution(Display *display, int *width, int *height) {
- *width = DefaultScreenOfDisplay(display)->width;
- *height = DefaultScreenOfDisplay(display)->height;
+ *width = XWidthOfScreen(DefaultScreenOfDisplay(display));
+ *height = XHeightOfScreen(DefaultScreenOfDisplay(display));
}
static mgl::Color interpolate_colors(mgl::Color source, mgl::Color target, double progress) {
@@ -649,11 +649,11 @@ namespace QuickMedia {
mgl::vec2i focused_monitor_center = get_focused_monitor_center(disp, monitor_size);
if(strcmp(plugin_name, "download") == 0) {
- window_size.x = std::min(900, monitor_size.x);
- window_size.y = std::min(900, monitor_size.y);
+ window_size.x = std::min(900, monitor_size.x - 100);
+ window_size.y = std::min(900, monitor_size.y - 100);
} else {
- window_size.x = std::min(window_size.x, monitor_size.x);
- window_size.y = std::min(window_size.y, monitor_size.y);
+ window_size.x = std::min(window_size.x, monitor_size.x - 100);
+ window_size.y = std::min(window_size.y, monitor_size.y - 100);
}
mgl::Window::CreateParams window_create_params;
@@ -7898,8 +7898,8 @@ namespace QuickMedia {
mgl::vec2i monitor_size;
mgl::vec2i focused_monitor_center = get_focused_monitor_center(disp, monitor_size);
- window_size.x = std::min(monitor_size.x, (int)(300.0f + 380.0f * get_config().scale));
- window_size.y = std::min(monitor_size.y, (int)(50.0f + 130.0f * get_config().scale));
+ window_size.x = std::min(monitor_size.x - 100, (int)(300.0f + 380.0f * get_config().scale));
+ window_size.y = std::min(monitor_size.y - 100, (int)(50.0f + 130.0f * get_config().scale));
window.set_size(mgl::vec2i(window_size.x, window_size.y));
window.set_size_limits(window_size, window_size);
window.set_position(mgl::vec2i(focused_monitor_center.x - window_size.x * 0.5f, focused_monitor_center.y - window_size.y * 0.5f));