~gnome3-team/gnome-screensaver/ubuntu

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From a3388633c5f55b08df4f3af48b0dc2f0ef06d143 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Thu, 02 Dec 2010 11:57:03 +0000
Subject: Remove and correct usages of size_request to fix compile

---
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index 70f324e..20a0eda 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -870,28 +870,6 @@ forward_key_events (GSLockPlug *plug)
 }
 
 static void
-gs_lock_plug_size_request (GtkWidget      *widget,
-                           GtkRequisition *requisition)
-{
-        int mod_width;
-        int mod_height;
-
-        if (GTK_WIDGET_CLASS (gs_lock_plug_parent_class)->size_request) {
-                GTK_WIDGET_CLASS (gs_lock_plug_parent_class)->size_request (widget, requisition);
-        }
-
-        mod_width = requisition->height * 1.3;
-        mod_height = requisition->width / 1.6;
-        if (requisition->width < mod_width) {
-                /* if the dialog is tall fill out the width */
-                requisition->width = mod_width;
-        } else if (requisition->height < mod_height) {
-                /* if the dialog is wide fill out the height */
-                requisition->height = mod_height;
-        }
-}
-
-static void
 gs_lock_plug_set_logout_enabled (GSLockPlug *plug,
                                  gboolean    logout_enabled)
 {
@@ -1082,7 +1060,6 @@ gs_lock_plug_class_init (GSLockPlugClass *klass)
         widget_class->style_set    = gs_lock_plug_style_set;
         widget_class->show         = gs_lock_plug_show;
         widget_class->hide         = gs_lock_plug_hide;
-        widget_class->size_request = gs_lock_plug_size_request;
 
         klass->close = gs_lock_plug_close;
 
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 0c1e729..eaaba36 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -2104,6 +2104,30 @@ gs_window_real_visibility_notify_event (GtkWidget          *widget,
 }
 
 static void
+gs_window_real_get_preferred_width (GtkWidget *widget,
+                               gint      *minimal_width,
+                               gint      *natural_width)
+{
+	GtkRequisition requisition;
+
+	gs_window_real_size_request (widget, &requisition);
+
+	*minimal_width = *natural_width = requisition.width;
+}
+
+static void
+gs_window_real_get_preferred_height (GtkWidget *widget,
+                                gint      *minimal_height,
+                                gint      *natural_height)
+{
+	GtkRequisition requisition;
+
+	gs_window_real_size_request (widget, &requisition);
+
+	*minimal_height = *natural_height = requisition.height;
+}
+
+static void
 gs_window_class_init (GSWindowClass *klass)
 {
         GObjectClass   *object_class = G_OBJECT_CLASS (klass);
@@ -2121,7 +2145,8 @@ gs_window_class_init (GSWindowClass *klass)
         widget_class->motion_notify_event = gs_window_real_motion_notify_event;
         widget_class->button_press_event  = gs_window_real_button_press_event;
         widget_class->scroll_event        = gs_window_real_scroll_event;
-        widget_class->size_request        = gs_window_real_size_request;
+        widget_class->get_preferred_width        = gs_window_real_get_preferred_width;
+        widget_class->get_preferred_height       = gs_window_real_get_preferred_height;
         widget_class->grab_broken_event   = gs_window_real_grab_broken;
         widget_class->visibility_notify_event = gs_window_real_visibility_notify_event;
 
--
cgit v0.8.3.1