vcl/unx/gtk3/gtkinst.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 53f90ba47376aac928c6666d34ef62473052bf6d
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Nov 28 20:55:40 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Nov 29 09:52:49 2021 +0100

    gtk3: set anchor_hints for gdk_window_move_to_rect
    
    Change-Id: Id7d79e0b505cfaadf1dbae770b69eea46b43157c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126007
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 523525e445a2..b10a051d963b 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -9797,24 +9797,27 @@ bool show_menu_newer_gtk(GtkWidget* pComboBox, 
GtkWindow* pMenu, const GdkRectan
 
     GdkGravity rect_anchor;
     GdkGravity menu_anchor;
+    GdkAnchorHints anchor_hints;
 
     if (ePlace == weld::Placement::Under)
     {
         rect_anchor = !bSwapForRTL ? GDK_GRAVITY_SOUTH_WEST : 
GDK_GRAVITY_SOUTH_EAST;
         menu_anchor = !bSwapForRTL ? GDK_GRAVITY_NORTH_WEST : 
GDK_GRAVITY_NORTH_EAST;
+        anchor_hints = static_cast<GdkAnchorHints>(GDK_ANCHOR_FLIP_Y | 
GDK_ANCHOR_RESIZE_Y |
+                                                   GDK_ANCHOR_SLIDE_X | 
GDK_ANCHOR_RESIZE_X);
     }
     else
     {
         rect_anchor = !bSwapForRTL ? GDK_GRAVITY_NORTH_EAST : 
GDK_GRAVITY_NORTH_WEST;
         menu_anchor = !bSwapForRTL ? GDK_GRAVITY_NORTH_WEST : 
GDK_GRAVITY_NORTH_EAST;
+        anchor_hints = static_cast<GdkAnchorHints>(GDK_ANCHOR_FLIP_X | 
GDK_ANCHOR_RESIZE_Y |
+                                                   GDK_ANCHOR_SLIDE_Y | 
GDK_ANCHOR_RESIZE_X);
     }
 
     GdkRectangle rect {x, y, rAnchor.width, rAnchor.height};
     GdkSurface* toplevel = widget_get_surface(GTK_WIDGET(pMenu));
 
-    window_move_to_rect(toplevel, &rect, rect_anchor, menu_anchor, 
static_cast<GdkAnchorHints>(0),
-                        /*static_cast<GdkAnchorHints>(GDK_ANCHOR_FLIP_Y | 
GDK_ANCHOR_RESIZE_Y |
-                                                    GDK_ANCHOR_SLIDE_X | 
GDK_ANCHOR_RESIZE_X),*/
+    window_move_to_rect(toplevel, &rect, rect_anchor, menu_anchor, 
anchor_hints,
                         0, 0);
 
     return true;

Reply via email to