Patch 8.2.2626
Problem:    GTK3: error when starting up and -geometry is given. (Dominique
            Pellé)
Solution:   Use another function to get the monitor if the window has not been
            created yet. (closes #7978)
Files:      src/gui_gtk_x11.c


*** ../vim-8.2.2625/src/gui_gtk_x11.c   2021-03-18 22:28:53.559835689 +0100
--- src/gui_gtk_x11.c   2021-03-20 12:34:02.709140852 +0100
***************
*** 4168,4176 ****
      GdkRectangle geometry;
      GdkWindow *win = gtk_widget_get_window(wid);
  #if GTK_CHECK_VERSION(3,22,0)
!     GdkDisplay *dpy = gtk_widget_get_display(wid);
!     GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win);
  
      gdk_monitor_get_geometry(monitor, &geometry);
  #else
      GdkScreen* screen;
--- 4168,4184 ----
      GdkRectangle geometry;
      GdkWindow *win = gtk_widget_get_window(wid);
  #if GTK_CHECK_VERSION(3,22,0)
!     GdkDisplay *dpy;
!     GdkMonitor *monitor;
  
+     if (wid != NULL && gtk_widget_get_realized(wid))
+       dpy = gtk_widget_get_display(wid);
+     else
+       dpy = gdk_display_get_default();
+     if (win != NULL)
+       monitor = gdk_display_get_monitor_at_window(dpy, win);
+     else
+       monitor = gdk_display_get_monitor_at_point(dpy, point_x, point_y);
      gdk_monitor_get_geometry(monitor, &geometry);
  #else
      GdkScreen* screen;
***************
*** 4180,4189 ****
        screen = gtk_widget_get_screen(wid);
      else
        screen = gdk_screen_get_default();
!     if (win == NULL)
!       monitor = gdk_screen_get_monitor_at_point(screen, point_x, point_y);
!     else
        monitor = gdk_screen_get_monitor_at_window(screen, win);
      gdk_screen_get_monitor_geometry(screen, monitor, &geometry);
  #endif
      *screen_x = geometry.x;
--- 4188,4197 ----
        screen = gtk_widget_get_screen(wid);
      else
        screen = gdk_screen_get_default();
!     if (win != NULL)
        monitor = gdk_screen_get_monitor_at_window(screen, win);
+     else
+       monitor = gdk_screen_get_monitor_at_point(screen, point_x, point_y);
      gdk_screen_get_monitor_geometry(screen, monitor, &geometry);
  #endif
      *screen_x = geometry.x;
*** ../vim-8.2.2625/src/version.c       2021-03-19 20:27:37.157524894 +0100
--- src/version.c       2021-03-20 12:36:03.360753653 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2626,
  /**/

-- 
A)bort, R)etry, B)ang it with a large hammer

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202103201137.12KBbgeN1761144%40masaka.moolenaar.net.

Raspunde prin e-mail lui