|
|
@ -513,21 +513,18 @@ static bool wayland_warp_pointer( GtkWidget* aWidget, GdkDisplay* aDisplay, GdkW |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow ) |
|
|
|
bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow ) |
|
|
|
{ |
|
|
|
wxLogTrace( traceWayland, wxS( "InfiniteDragPrepareWindow" ) ); |
|
|
|
|
|
|
|
if( s_wl_confined_pointer != NULL ) |
|
|
|
{ |
|
|
|
KIPLATFORM::UI::InfiniteDragReleaseWindow(); |
|
|
|
} |
|
|
|
|
|
|
|
GtkWidget* widget = static_cast<GtkWidget*>( aWindow->GetHandle() ); |
|
|
|
GdkDisplay* disp = gtk_widget_get_display( widget ); |
|
|
|
|
|
|
|
if( !GDK_IS_WAYLAND_DISPLAY( disp ) ) |
|
|
|
if( GDK_IS_WAYLAND_DISPLAY( disp ) ) |
|
|
|
{ |
|
|
|
return; |
|
|
|
if( s_wl_confined_pointer != NULL ) |
|
|
|
{ |
|
|
|
KIPLATFORM::UI::InfiniteDragReleaseWindow(); |
|
|
|
} |
|
|
|
|
|
|
|
GdkSeat* seat = gdk_display_get_default_seat( disp ); |
|
|
@ -552,9 +549,18 @@ void KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow ) |
|
|
|
s_wl_pointer_constraints, wlsurf, wlptr, s_wl_confinement_region, |
|
|
|
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT ); |
|
|
|
|
|
|
|
zwp_confined_pointer_v1_add_listener(s_wl_confined_pointer, &confined_pointer_listener, NULL); |
|
|
|
zwp_confined_pointer_v1_add_listener( s_wl_confined_pointer, &confined_pointer_listener, |
|
|
|
NULL ); |
|
|
|
|
|
|
|
wl_display_roundtrip( wldisp ); |
|
|
|
} |
|
|
|
else if( wxGetEnv( wxT( "WAYLAND_DISPLAY" ), nullptr ) ) |
|
|
|
{ |
|
|
|
// Not working under XWayland
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -579,9 +585,10 @@ void KIPLATFORM::UI::InfiniteDragReleaseWindow() |
|
|
|
#else // No Wayland support
|
|
|
|
|
|
|
|
|
|
|
|
void KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow ) |
|
|
|
bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow ) |
|
|
|
{ |
|
|
|
// Not needed on X11
|
|
|
|
// Not working under XWayland
|
|
|
|
return !wxGetEnv( wxT( "WAYLAND_DISPLAY" ), nullptr ); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|