[gnome-boxes] Remove the resize/restore logic



commit ec0d35d5fc9365c9485c21d4131495843b8b6106
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Thu Oct 6 02:34:18 2011 +0200

    Remove the resize/restore logic
    
    The design document says we shouldn't do that.

 src/app.vala |   28 ----------------------------
 src/box.vala |   19 -------------------
 2 files changed, 0 insertions(+), 47 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 15671b8..6271948 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -89,12 +89,6 @@ private class Boxes.App: Boxes.UI {
 
         window.destroy.connect (quit);
         window.key_press_event.connect (on_key_pressed);
-        window.configure_event.connect ((event) => {
-            if (event.type == Gdk.EventType.CONFIGURE)
-                save_window_size ();
-
-            return false;
-        });
 
         box_table = new Clutter.TableLayout ();
         box = new Clutter.Box (box_table);
@@ -137,7 +131,6 @@ private class Boxes.App: Boxes.UI {
             state.set_state ("creds");
             break;
         case UIState.COLLECTION:
-            restore_window_size ();
             state.set_state ("collection");
             break;
         default:
@@ -146,27 +139,6 @@ private class Boxes.App: Boxes.UI {
         }
     }
 
-    public void save_window_size () {
-        float width, height;
-
-		if (ui_state == UIState.DISPLAY)
-			return;
-
-        window.get_size (out width, out height);
-        window.default_width = (int) width;
-        window.default_height = (int) height;
-    }
-
-    public void restore_window_size () {
-        window.resize (window.default_width, window.default_height);
-    }
-
-    public void set_window_size (int width, int height, bool save=false) {
-        if (save)
-            save_window_size ();
-        window.resize (width, height);
-    }
-
     public void quit () {
         Gtk.main_quit ();
     }
diff --git a/src/box.vala b/src/box.vala
index e61abd2..6dcccbb 100644
--- a/src/box.vala
+++ b/src/box.vala
@@ -195,10 +195,6 @@ private class Boxes.BoxActor: Boxes.UI {
     private Gtk.Widget? display;
     private Box box;
 
-    // signal handler IDs
-    private ulong width_req_id;
-    private ulong height_req_id;
-
     public BoxActor (Box box) {
         this.box = box;
 
@@ -247,10 +243,7 @@ private class Boxes.BoxActor: Boxes.UI {
         actor_remove (screenshot);
 
         this.display = display;
-        width_req_id = display.notify["width-request"].connect ((pspec) => { update_display_size (); });
-        height_req_id = display.notify["height-request"].connect ((pspec) => { update_display_size (); });
         vbox.add (display);
-        update_display_size ();
 
         display.show ();
         display.grab_focus ();
@@ -261,8 +254,6 @@ private class Boxes.BoxActor: Boxes.UI {
             return;
 
         vbox.remove (display);
-        display.disconnect (width_req_id);
-        display.disconnect (height_req_id);
         display = null;
 
         actor.pack_at (screenshot, 0);
@@ -310,15 +301,5 @@ private class Boxes.BoxActor: Boxes.UI {
             break;
         }
     }
-
-    private void update_display_size () {
-        if (display.width_request < 320 || display.height_request < 200) {
-            // filter invalid size request
-            // TODO: where does it come from
-            return;
-        }
-
-        box.app.set_window_size (display.width_request, display.height_request);
-    }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]