From 7a82b2c33d5b7585dc48d15619d13d5c63d9eb10 Mon Sep 17 00:00:00 2001 From: Steffen Pohle Date: Tue, 6 Dec 2022 21:09:52 +0100 Subject: [PATCH] read out monitor geometry, in case we need it --- configuration.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/configuration.cc b/configuration.cc index 164a889..1180ed5 100644 --- a/configuration.cc +++ b/configuration.cc @@ -223,6 +223,30 @@ void Configuration::LoadConfig(std::string filename) { } } + + // + // check is the windows are inside the screen + // not really needed since gnome seem to take care about the windows positions + // and placement quite well. + GdkDisplay *dsp = gdk_display_get_default(); + int n_monitor = -1; + if (dsp) { + n_monitor = gdk_display_get_n_monitors (dsp); + } + + if (dsp && n_monitor > 0) { + GdkMonitor *g_monitor; + GdkRectangle geometry; + for (i = 0; i < n_monitor; i++) { + g_monitor = gdk_display_get_monitor(dsp, i); + if (g_monitor) { + gdk_monitor_get_geometry(g_monitor, &geometry); + printf ("%s:%d Monitor %d Pos:%d,%d Size:%d x %d\n", __FILE__, __LINE__, i, + geometry.x, geometry.y, geometry.width, geometry.height); + } + } + } + // // load windows position for (i = 0; i < 5; i++) {