Browse Source

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

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

8
meson.build

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

7
src/greeter.c

@ -373,7 +373,14 @@ main(int argc, char **argv) {
screen = gtk_window_get_screen(GTK_WINDOW(window)); screen = gtk_window_get_screen(GTK_WINDOW(window));
gtk_window_set_decorated(GTK_WINDOW(window), FALSE); gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
#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); 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_set_default_size(GTK_WINDOW(window), geometry.width, geometry.height);
gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y); gtk_window_move(GTK_WINDOW(window), geometry.x, geometry.y);

Loading…
Cancel
Save