Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:zhy20120210:home:zhy20120210:SLES-11-SP1-x86-64
gdm
gdm-login-window-size.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gdm-login-window-size.patch of Package gdm
--- trunk/gui/simple-greeter/gdm-greeter-login-window.c 2008/11/18 22:18:29 6599 +++ trunk/gui/simple-greeter/gdm-greeter-login-window.c 2009/01/14 22:59:37 6662 @@ -543,7 +543,6 @@ switch (number) { case MODE_SELECTION: - gtk_widget_set_size_request (GTK_WIDGET (login_window), -1, -1); set_log_in_button_mode (login_window, LOGIN_BUTTON_HIDDEN); show_widget (login_window, "cancel-button", FALSE); @@ -568,9 +567,6 @@ default_name = NULL; break; case MODE_AUTHENTICATION: - gtk_widget_set_size_request (GTK_WIDGET (login_window), - GTK_WIDGET (login_window)->allocation.width, - -1); show_widget (login_window, "cancel-button", TRUE); show_widget (login_window, "shutdown-button", FALSE); show_widget (login_window, "restart-button", FALSE); @@ -1656,16 +1652,22 @@ gdm_greeter_login_window_size_request (GtkWidget *widget, GtkRequisition *requisition) { - int screen_w; - int screen_h; - GtkRequisition child_requisition; + int monitor; + GdkScreen *screen; + GtkRequisition child_requisition; + GdkRectangle area; if (GTK_WIDGET_CLASS (gdm_greeter_login_window_parent_class)->size_request) { GTK_WIDGET_CLASS (gdm_greeter_login_window_parent_class)->size_request (widget, requisition); } - screen_w = gdk_screen_get_width (gtk_widget_get_screen (widget)); - screen_h = gdk_screen_get_height (gtk_widget_get_screen (widget)); + if (!GTK_WIDGET_REALIZED (widget)) { + return; + } + + screen = gtk_widget_get_screen (widget); + monitor = gdk_screen_get_monitor_at_window (screen, widget->window); + gdk_screen_get_monitor_geometry (screen, monitor, &area); gtk_widget_get_child_requisition (GTK_BIN (widget)->child, &child_requisition); *requisition = child_requisition; @@ -1676,8 +1678,12 @@ /* Make width be at least 33% screen width * and height be at most 80% of screen height */ - requisition->width = MAX (requisition->width, .33 * screen_w); - requisition->height = MIN (requisition->height, .80 * screen_h); + requisition->width = MAX (requisition->width, .33 * area.width); + requisition->height = MIN (requisition->height, .80 * area.height); + + /* Don't ever shrink window width + */ + requisition->width = MAX (requisition->width, widget->allocation.width); } static void
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor