diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-22 16:28:26 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-22 16:28:26 +0000 |
commit | 71a4796dc3dbf8a7fe1df5c5d7acea388b40eae0 (patch) | |
tree | 0fba71173e48e99c010549949e6872d8299d433b /gtk2_ardour/utils.cc | |
parent | 43bcb7f72b8ea64bab7861ff24d488d4d09a7293 (diff) |
forward port of 7539 from 2.x
git-svn-id: svn://localhost/ardour2/branches/3.0@7667 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index f9cc0739c6..8884e762da 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -1054,3 +1054,32 @@ control_link (ScopedConnectionList& scl, boost::shared_ptr<Controllable> c, Gtk: gui_context()); } +int +physical_screen_height (Glib::RefPtr<Gdk::Window> win) +{ + GdkScreen* scr = gdk_screen_get_default(); + + if (win) { + GdkRectangle r; + gint monitor = gdk_screen_get_monitor_at_window (scr, win->gobj()); + gdk_screen_get_monitor_geometry (scr, monitor, &r); + return r.height; + } else { + return gdk_screen_get_height (scr); + } +} + +int +physical_screen_width (Glib::RefPtr<Gdk::Window> win) +{ + GdkScreen* scr = gdk_screen_get_default(); + + if (win) { + GdkRectangle r; + gint monitor = gdk_screen_get_monitor_at_window (scr, win->gobj()); + gdk_screen_get_monitor_geometry (scr, monitor, &r); + return r.width; + } else { + return gdk_screen_get_width (scr); + } +} |