Skip to content

Commit

Permalink
osc.c: replace deprecated gtk3 functions
Browse files Browse the repository at this point in the history
replace gdk_screen_get_width/height with monitor geometry

Signed-off-by: Cristina Suteu <[email protected]>
  • Loading branch information
cristina-suteu committed Jan 8, 2024
1 parent 6fdcbbc commit 99d12f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions osc.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,12 @@ void move_gtk_window_on_screen(GtkWindow *window,
// get screen dimensions
GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(window));
GdkScreen *screen = gdk_window_get_screen(gdk_window);
gint screen_w = gdk_screen_get_width(screen);
gint screen_h = gdk_screen_get_height(screen);
GdkDisplay *display = gdk_screen_get_display(screen);
GdkMonitor *monitor = gdk_display_get_monitor_at_window(display, gdk_window);
GdkRectangle geometry;
gdk_monitor_get_geometry(monitor, &geometry);
gint screen_w = geometry.width;
gint screen_h = geometry.height;

gint window_w;
gint window_h;
Expand Down

0 comments on commit 99d12f1

Please sign in to comment.