Patch 9.0.0984
Problem:    GUI: remote_foreground() does not always work. (Ron Aaron)
Solution:   For GTK use gtk_window_set_keep_above(). (issue #11641)
Files:      src/gui_gtk_x11.c


*** ../vim-9.0.0983/src/gui_gtk_x11.c   2022-11-30 18:11:52.690904297 +0000
--- src/gui_gtk_x11.c   2022-12-01 19:36:37.980211594 +0000
***************
*** 780,786 ****
            for (i = 0; i < list->num_rectangles; i++)
            {
                const cairo_rectangle_t *rect = &list->rectangles[i];
!               cairo_rectangle(cr, rect->x, rect->y, rect->width, 
rect->height);
                cairo_fill(cr);
            }
        }
--- 780,787 ----
            for (i = 0; i < list->num_rectangles; i++)
            {
                const cairo_rectangle_t *rect = &list->rectangles[i];
!               cairo_rectangle(cr, rect->x, rect->y,
!                                                   rect->width, rect->height);
                cairo_fill(cr);
            }
        }
***************
*** 6313,6319 ****
--- 6314,6330 ----
      void
  gui_mch_set_foreground(void)
  {
+     // Just calling gtk_window_present() used to work in the past, but now 
this
+     // sequence appears to be needed:
+     // - Show the window on top of others.
+     // - Present the window (also shows it above others).
+     // - Do not the window on top of others (otherwise it would be stuck 
there).
+     gtk_window_set_keep_above(GTK_WINDOW(gui.mainwin), TRUE);
+     gui_may_flush();
      gtk_window_present(GTK_WINDOW(gui.mainwin));
+     gui_may_flush();
+     gtk_window_set_keep_above(GTK_WINDOW(gui.mainwin), FALSE);
+     gui_may_flush();
  }
  #endif
  
*** ../vim-9.0.0983/src/version.c       2022-12-01 19:25:00.444755203 +0000
--- src/version.c       2022-12-01 19:37:55.764159541 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     984,
  /**/

-- 
Some of the well known MS-Windows errors:
        ETIME           Wrong time, wait a little while
        ECRASH          Try again...
        EDETECT         Unable to detect errors
        EOVER           You lost!  Play another game?
        ENOCLUE         Eh, what did you want?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/20221201194126.9E73A1C0A1D%40moolenaar.net.

Raspunde prin e-mail lui