limit meterbridge window height to multiples of 16px
authorRobin Gareus <robin@gareus.org>
Wed, 10 Jul 2013 00:42:29 +0000 (02:42 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 10 Jul 2013 13:27:17 +0000 (15:27 +0200)
(workaround to bad resizing performance, realloc drawing areas)

gtk2_ardour/meterbridge.cc

index 9dee2beeaa2ffb5edba23092faf2b944d062bc49..74c13f45eb6c859bc0e941c6b0e259a31dbac019 100644 (file)
@@ -118,7 +118,9 @@ Meterbridge::Meterbridge ()
        Gdk::Geometry geom;
        geom.max_width = 1<<16;
        geom.max_height = max_height;
-       set_geometry_hints(*((Gtk::Window*) this), geom, Gdk::HINT_MAX_SIZE);
+       geom.height_inc = 16;
+       geom.width_inc = 1;
+       set_geometry_hints(*((Gtk::Window*) this), geom, Gdk::HINT_MAX_SIZE | Gdk::HINT_RESIZE_INC);
 
        set_keep_above (true);
        set_border_width (0);
@@ -331,7 +333,9 @@ Meterbridge::on_size_request (Gtk::Requisition* r)
 
        if (cur_max_width != geom.max_width) {
                cur_max_width = geom.max_width;
-               set_geometry_hints(*((Gtk::Window*) this), geom, Gdk::HINT_MAX_SIZE);
+               geom.height_inc = 16;
+               geom.width_inc = 1;
+               set_geometry_hints(*((Gtk::Window*) this), geom, Gdk::HINT_MAX_SIZE | Gdk::HINT_RESIZE_INC);
        }
 }