Browse Source

Set geometry hints for max width and height

sisyphus
Dustin Falgout 9 years ago
parent
commit
82da7ee776
  1. 18
      src/lightdm-webkit2-greeter.c

18
src/lightdm-webkit2-greeter.c

@ -69,8 +69,7 @@ sigterm_cb (int signum)
}
int
main (int argc, char **argv)
{
main(int argc, char **argv) {
GdkScreen *screen;
GdkRectangle geometry;
GKeyFile *keyfile;
@ -91,10 +90,23 @@ main (int argc, char **argv)
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
screen = gtk_window_get_screen(GTK_WINDOW(window));
gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry);
GdkGeometry hints;
hints.min_width = geometry.width;
hints.max_width = geometry.width;
hints.min_height = geometry.height;
hints.max_height = geometry.height;
gtk_window_set_geometry_hints(GTK_WINDOW(window), window, &hints,
(GdkWindowHints)(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE));
gtk_window_set_default_size(GTK_WINDOW(window), geometry.width, geometry.height);
gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y);
gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new_for_display (gtk_widget_get_display (window), GDK_LEFT_PTR));
gdk_window_set_cursor(gdk_get_default_root_window(),
gdk_cursor_new_for_display(gtk_widget_get_display(window), GDK_LEFT_PTR));
web_view = webkit_web_view_new();

Loading…
Cancel
Save