Browse Source

discontinue use of some deprecated methods if built with gtk 3.22+

sisyphus
Dustin Falgout 8 years ago
parent
commit
312e23c23c
  1. 10
      meson.build
  2. 9
      src/greeter.c

10
meson.build

@ -30,7 +30,7 @@ webext_deps = [webkit2_webext, lightdm_gobject]
has_webkitgtk_2_14 = webkit2.version().version_compare('>=2.14.0')
has_lightdm_1_19_2 = lightdm_gobject.version().version_compare('>=1.19.2')
has_gtk_3_22 = gtk3.version().version_compare('>=3.22')
# =================================== #
# ------->>> Configuration <<<------- #
@ -56,12 +56,18 @@ conf.set('DESKTOP_DIR', '"@0@"'.format(get_option('with-desktop-dir')))
conf.set('WEBEXT_DIR', '"@0@"'.format(get_option('with-webext-dir')))
conf.set('HAS_WEBKITGTK_2_14', has_webkitgtk_2_14)
if has_webkitgtk_2_14
conf.set('HAS_WEBKITGTK_2_14', has_webkitgtk_2_14)
endif
if has_lightdm_1_19_2
conf.set('HAS_LIGHTDM_1_19_2', has_lightdm_1_19_2)
endif
if has_gtk_3_22
conf.set('HAS_GTK_3_22', has_gtk_3_22)
endif
# ===================================== #
# ------->>> Sub Directories <<<------- #

9
src/greeter.c

@ -373,7 +373,14 @@ main(int argc, char **argv) {
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);
#ifdef HAS_GTK_3_22
GdkMonitor *monitor = gdk_display_get_primary_monitor(default_display);
gdk_monitor_get_geometry(monitor, &geometry);
#else
gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry);
#endif
gtk_window_set_default_size(GTK_WINDOW(window), geometry.width, geometry.height);
gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y);

Loading…
Cancel
Save