diff options
author | Carl Hetherington <carl@carlh.net> | 2009-08-29 20:48:11 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-08-29 20:48:11 +0000 |
commit | 7c49119be05c2a0fc324f6a13e91720ac66a5957 (patch) | |
tree | fbe62f03a5430857e995cd0ab1bd5f304bfd4444 /gtk2_ardour/utils.cc | |
parent | 94c5a98e025a8ef9976e5758a6504f1c9b90b16b (diff) |
Modify hacks associated with initial sizing of port matrices to try and make things work with both fluxbox and metacity.
git-svn-id: svn://localhost/ardour2/branches/3.0@5604 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 5e5534222e..a5dcd72438 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -923,3 +923,16 @@ convert_bgra_to_rgba (guint8 const* src, src_pixel += 4; } } + +void +resize_window_to_proportion_of_monitor (Gtk::Window* window, int max_width, int max_height) +{ + Glib::RefPtr<Gdk::Screen> screen = window->get_screen (); + Gdk::Rectangle monitor_rect; + screen->get_monitor_geometry (0, monitor_rect); + + int const w = std::min (monitor_rect.get_width(), max_width) * 0.8; + int const h = std::min (monitor_rect.get_height(), max_height) * 0.8; + + window->resize (w, h); +} |