diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-03-10 10:33:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-03-10 10:41:38 +0000 |
commit | 51d1fca2041ba4478c5abae59b1ed4fee37ea1ee (patch) | |
tree | eccae16d5e06a8c05d4cc7ddf1951ac90246dc52 /vcl/unx | |
parent | 6802f760a69f3b1f203d70399f0d73764f9159d5 (diff) |
Related: tdf#98419 gtk3: reimplement passing window move control to wm...
for wayland
Dragging toolbars around to move them (starting with an undocked toolbar, not
the moving outline fake thing) doesn't work under wayland (as far as I can see)
without using gtk_window_begin_move_drag i.e. gtk_window_move doesn't work.
But this is supposed to be used from the initial mouse click (while it works
under wayland from a move, it doesn't work under X from a move) so rework the
last attempt to occur right at the initial click to drag.
Change-Id: I612f188b3e8482307bc816f5aa775530e6092eda
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 1e69fe3d86b2..bdd5499d57fa 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -888,23 +888,6 @@ void GtkSalFrame::moveWindow( long nX, long nY ) gtk_window_move( GTK_WINDOW(m_pWindow), nX, nY ); } -void GtkSalFrame::dragWindowTo(long nX, long nY) -{ - if (isChild(false)) - moveWindow(nX, nY); - else - { -#if defined(GDK_WINDOWING_WAYLAND) - if (GDK_IS_WAYLAND_DISPLAY(getGdkDisplay())) - { - gtk_window_begin_move_drag(GTK_WINDOW(m_pWindow), 1, nX, nY, GDK_CURRENT_TIME); - return; - } -#endif - gtk_window_move(GTK_WINDOW(m_pWindow), nX, nY); - } -} - void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) { gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight ); @@ -1649,10 +1632,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u m_bDefaultPos = false; - if (nFlags & SAL_FRAME_POSSIZE_BYDRAG) - dragWindowTo(nX, nY); - else - moveWindow(nX, nY); + moveWindow(nX, nY); updateScreenNumber(); } @@ -2564,6 +2544,26 @@ bool GtkSalFrame::HidePopover(sal_uIntPtr nId) #endif } +void GtkSalFrame::StartToolKitMoveBy() +{ + GdkEvent *pEvent = gtk_get_current_event(); + if (!pEvent) + { + SAL_WARN("vcl.gtk", "no current event for starting window move by wm"); + return; + } + if (pEvent->type != GDK_BUTTON_PRESS) + { + SAL_WARN("vcl.gtk", "current event for starting window move by wm is not a button"); + return; + } + gtk_window_begin_move_drag(GTK_WINDOW(m_pWindow), + pEvent->button.button, + pEvent->button.x_root, + pEvent->button.y_root, + pEvent->button.time); +} + gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame ) { GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); |