csete / gpredict

Gpredict satellite tracking application
http://gpredict.oz9aec.net/
GNU General Public License v2.0
877 stars 250 forks source link

gdk_screen_width() and gdk_screen_height() are deprecated #146

Closed csete closed 4 years ago

csete commented 6 years ago

See for example:

gtk-sat-module-popup.c: In function ‘module_window_config_cb’:
gtk-sat-module-popup.c:1215:9: warning: ‘gdk_screen_width’ is deprecated [-Wdeprecated-declarations]
         x > gdk_screen_width() || y > gdk_screen_height())
         ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from gtk-sat-module-popup.c:26:
/usr/include/gtk-3.0/gdk/gdkmain.h:108:6: note: declared here
 gint gdk_screen_width  (void) G_GNUC_CONST;
      ^~~~~~~~~~~~~~~~
gtk-sat-module-popup.c:1215:9: warning: ‘gdk_screen_height’ is deprecated [-Wdeprecated-declarations]
         x > gdk_screen_width() || y > gdk_screen_height())
         ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50:0,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from gtk-sat-module-popup.c:26:
/usr/include/gtk-3.0/gdk/gdkmain.h:110:6: note: declared here
 gint gdk_screen_height (void) G_GNUC_CONST;
      ^~~~~~~~~~~~~~~~~
  CC       gtk-sat-module-tmg.o
  CC       gtk-sat-popup-common.o
  CC       gtk-sat-selector.o
  CC       gtk-single-sat.o
csete commented 5 years ago

I am unable to find a replacement in Gdk 3.18 (Ubuntu 16.04)

f1ixx commented 5 years ago

Hi, to remove warning (don't know for multi monitor) : before the test (at line 1218 for me) add :

GdkRectangle workarea = {0};
gdk_monitor_get_workarea(gdk_display_get_primary_monitor(gdk_display_get_default()), &workarea);

and change the variable in test line :

gdk_screen_width() => workarea.width
gdk_screen_height() => workarea.height

Hoping to have helped a little Best 73's

Boris, F1IXX

csete commented 5 years ago

Hi Boris,

Thanks for the tip! I will take a look and also test it with multi-monitor setup.

Alex, OZ9AEC