KiCad PCB EDA Suite
Loading...
Searching...
No Matches
wxgtk/ui.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Ian McInerney <Ian.S.McInerney at ieee.org>
5 * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <kiplatform/ui.h>
22
23#include <wx/choice.h>
24#include <wx/nonownedwnd.h>
25#include <wx/settings.h>
26#include <wx/window.h>
27#include <wx/log.h>
28
29#include <gtk/gtk.h>
30#include <gdk/gdk.h>
31
32#ifdef GDK_WINDOWING_X11
33#include <gdk/gdkx.h>
34#endif
35
36#ifdef GDK_WINDOWING_WAYLAND
37#include <gdk/gdkwayland.h>
38#endif
39
40#ifdef KICAD_WAYLAND
42#endif
43
44// Set WXTRACE=KICAD_WAYLAND to see logs
45const wxString traceWayland = wxS( "KICAD_WAYLAND" );
46
47
49{
50 wxColour bg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
51
52 // Weighted W3C formula
53 double brightness = ( bg.Red() / 255.0 ) * 0.299 +
54 ( bg.Green() / 255.0 ) * 0.587 +
55 ( bg.Blue() / 255.0 ) * 0.117;
56
57 return brightness < 0.5;
58}
59
60
62{
63 return wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
64}
65
66
67void KIPLATFORM::UI::ForceFocus( wxWindow* aWindow )
68{
69 aWindow->SetFocus();
70}
71
72
73bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
74{
75 if( !aWindow )
76 return false;
77
78 GtkWindow* window = GTK_WINDOW( aWindow->GetHandle() );
79
80 if( window )
81 return gtk_window_is_active( window );
82
83 // We shouldn't really ever reach this point
84 return false;
85}
86
87
88void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
89{
90 // Not needed on this platform
91}
92
93
95{
96 // Not needed on this platform
97}
98
99
100bool KIPLATFORM::UI::IsStockCursorOk( wxStockCursor aCursor )
101{
102 switch( aCursor )
103 {
104 case wxCURSOR_BULLSEYE:
105 case wxCURSOR_HAND:
106 case wxCURSOR_ARROW:
107 case wxCURSOR_BLANK:
108 return true;
109 default:
110 return false;
111 }
112}
113
114
123static void disable_area_apply_attributes_cb( GtkWidget* pItem, gpointer userdata )
124{
125 // GTK needs this enormous chain to get the actual type of item that we want
126 GtkMenuItem* pMenuItem = GTK_MENU_ITEM( pItem );
127 GtkWidget* child = gtk_bin_get_child( GTK_BIN( pMenuItem ) );
128 GtkCellView* pCellView = GTK_CELL_VIEW( child );
129 GtkCellLayout* pCellLayout = GTK_CELL_LAYOUT( pCellView );
130 GtkCellArea* pCellArea = gtk_cell_layout_get_area( pCellLayout );
131
132 g_signal_handlers_block_matched( pCellArea, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, userdata );
133}
134
135
136void KIPLATFORM::UI::LargeChoiceBoxHack( wxChoice* aChoice )
137{
138 AtkObject* atkObj = gtk_combo_box_get_popup_accessible( GTK_COMBO_BOX( aChoice->m_widget ) );
139
140 if( !atkObj || !GTK_IS_ACCESSIBLE( atkObj ) )
141 return;
142
143 GtkWidget* widget = gtk_accessible_get_widget( GTK_ACCESSIBLE( atkObj ) );
144
145 if( !widget || !GTK_IS_MENU( widget ) )
146 return;
147
148 GtkMenu* menu = GTK_MENU( widget );
149
150 gtk_container_foreach( GTK_CONTAINER( menu ), disable_area_apply_attributes_cb, menu );
151}
152
153
154void KIPLATFORM::UI::EllipsizeChoiceBox( wxChoice* aChoice )
155{
156 // This function is based on the code inside the function post_process_ui in
157 // gtkfilechooserwidget.c
158 GList* cells = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( aChoice->m_widget ) );
159
160 if( !cells )
161 return;
162
163 GtkCellRenderer* cell = (GtkCellRenderer*) cells->data;
164
165 if( !cell )
166 return;
167
168 g_object_set( G_OBJECT( cell ), "ellipsize", PANGO_ELLIPSIZE_END, nullptr );
169
170 // Only the list of cells must be freed, the renderer isn't ours to free
171 g_list_free( cells );
172}
173
174
175double KIPLATFORM::UI::GetPixelScaleFactor( const wxWindow* aWindow )
176{
177 double val = 1.0;
178
179 GtkWidget* widget = static_cast<GtkWidget*>( aWindow->GetHandle() );
180
181 if( widget && gtk_check_version( 3, 10, 0 ) == nullptr )
182 val = gtk_widget_get_scale_factor( widget );
183
184 return val;
185}
186
187
188double KIPLATFORM::UI::GetContentScaleFactor( const wxWindow* aWindow )
189{
190 // TODO: Do we need something different here?
191 return GetPixelScaleFactor( aWindow );
192}
193
194
195wxSize KIPLATFORM::UI::GetUnobscuredSize( const wxWindow* aWindow )
196{
197 return wxSize( aWindow->GetSize().GetX() - wxSystemSettings::GetMetric( wxSYS_VSCROLL_X ),
198 aWindow->GetSize().GetY() - wxSystemSettings::GetMetric( wxSYS_HSCROLL_Y ) );
199}
200
201
202void KIPLATFORM::UI::SetOverlayScrolling( const wxWindow* aWindow, bool overlay )
203{
204 gtk_scrolled_window_set_overlay_scrolling( GTK_SCROLLED_WINDOW( aWindow->GetHandle() ),
205 overlay );
206}
207
208
210{
211 gboolean allowed = 1;
212
213 g_object_get( gtk_settings_get_default(), "gtk-menu-images", &allowed, NULL );
214
215 return !!allowed;
216}
217
218
219#if defined( GDK_WINDOWING_WAYLAND ) && defined( KICAD_WAYLAND )
220
221static bool wayland_warp_pointer( GtkWidget* aWidget, GdkDisplay* aDisplay, GdkWindow* aWindow,
222 GdkDevice* aPtrDev, int aX, int aY );
223
224// GDK doesn't know if we've moved the cursor using Wayland pointer constraints.
225// So emulate the actual position here
226static wxPoint s_warped_from;
227static wxPoint s_warped_to;
228
230{
231 wxPoint wx_pos = wxGetMousePosition();
232
233 if( wx_pos == s_warped_from )
234 {
235 wxLogTrace( traceWayland, wxS( "Faked mouse pos %d %d -> %d %d" ), wx_pos.x, wx_pos.y,
236 s_warped_to.x, s_warped_to.y );
237
238 return s_warped_to;
239 }
240 else
241 {
242 // Mouse has moved
243 s_warped_from = wxPoint();
244 s_warped_to = wxPoint();
245 }
246
247 return wx_pos;
248}
249
250#endif
251
252
253bool KIPLATFORM::UI::WarpPointer( wxWindow* aWindow, int aX, int aY )
254{
255 if( !wxGetEnv( wxT( "WAYLAND_DISPLAY" ), nullptr ) )
256 {
257 aWindow->WarpPointer( aX, aY );
258 return true;
259 }
260 else
261 {
262 GtkWidget* widget = static_cast<GtkWidget*>( aWindow->GetHandle() );
263
264 GdkDisplay* disp = gtk_widget_get_display( widget );
265 GdkSeat* seat = gdk_display_get_default_seat( disp );
266 GdkDevice* ptrdev = gdk_seat_get_pointer( seat );
267
268#if defined( GDK_WINDOWING_WAYLAND ) && defined( KICAD_WAYLAND )
269 if( GDK_IS_WAYLAND_DISPLAY( disp ) )
270 {
271 wxPoint initialPos = wxGetMousePosition();
272 GdkWindow* win = aWindow->GTKGetDrawingWindow();
273
274 if( wayland_warp_pointer( widget, disp, win, ptrdev, aX, aY ) )
275 {
276 s_warped_from = initialPos;
277 s_warped_to = aWindow->ClientToScreen( wxPoint( aX, aY ) );
278
279 wxLogTrace( traceWayland, wxS( "Set warped from %d %d to %d %d" ), s_warped_from.x,
280 s_warped_from.y, s_warped_to.x, s_warped_to.y );
281
282 return true;
283 }
284
285 wxLogTrace( traceWayland, wxS( "*** Warp to %d %d failed ***" ), aX, aY );
286
287 return false;
288 }
289#endif
290#ifdef GDK_WINDOWING_X11
291 if( GDK_IS_X11_DISPLAY( disp ) )
292 {
293 GdkWindow* win = gdk_device_get_window_at_position( ptrdev, nullptr, nullptr );
294 GdkCursor* blank_cursor = gdk_cursor_new_for_display( disp, GDK_BLANK_CURSOR );
295 GdkCursor* cur_cursor = gdk_window_get_cursor( win );
296
297 if( cur_cursor )
298 g_object_ref( cur_cursor );
299
300 gdk_window_set_cursor( win, blank_cursor );
301 aWindow->WarpPointer( aX, aY );
302 gdk_window_set_cursor( win, cur_cursor );
303
304 if( cur_cursor )
305 g_object_unref( cur_cursor );
306
307 if( blank_cursor )
308 g_object_unref( blank_cursor );
309
310 return true;
311 }
312#endif
313 }
314
315 return false;
316}
317
318
319void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
320{
321}
322
323
325{
326 wxWindowGTK* win = static_cast<wxWindowGTK*>( aWindow );
327 if( win )
328 {
329 GtkIMContext* imContext = win->m_imContext;
330 if( imContext )
331 {
332 gtk_im_context_focus_out( imContext );
333 }
334 }
335}
336
337
338void KIPLATFORM::UI::SetFloatLevel( wxWindow* aWindow )
339{
340}
341
342//
343// **** Wayland hacks ahead ****
344//
345
346#if defined( GDK_WINDOWING_WAYLAND ) && defined( KICAD_WAYLAND )
347
348static bool s_wl_initialized = false;
349static struct wl_compositor* s_wl_compositor = NULL;
350static struct zwp_pointer_constraints_v1* s_wl_pointer_constraints = NULL;
351static struct zwp_confined_pointer_v1* s_wl_confined_pointer = NULL;
352static struct wl_region* s_wl_confinement_region = NULL;
353static bool s_wl_locked_flag = false;
354
355static void handle_global( void* data, struct wl_registry* registry, uint32_t name,
356 const char* interface, uint32_t version )
357{
358 wxLogTrace( traceWayland, "handle_global received %s name %u version %u", interface,
359 (unsigned int) name, (unsigned int) version );
360
361 if( strcmp( interface, wl_compositor_interface.name ) == 0 )
362 {
363 s_wl_compositor = static_cast<wl_compositor*>(
364 wl_registry_bind( registry, name, &wl_compositor_interface, version ) );
365 }
366 else if( strcmp( interface, zwp_pointer_constraints_v1_interface.name ) == 0 )
367 {
368 s_wl_pointer_constraints = static_cast<zwp_pointer_constraints_v1*>( wl_registry_bind(
369 registry, name, &zwp_pointer_constraints_v1_interface, version ) );
370 }
371}
372
373static void handle_global_remove( void*, struct wl_registry*, uint32_t name )
374{
375 wxLogTrace( traceWayland, "handle_global_remove name %u", (unsigned int) name );
376}
377
378static const struct wl_registry_listener registry_listener = {
379 .global = handle_global,
380 .global_remove = handle_global_remove,
381};
382
383static void confined_handler( void* data, struct zwp_confined_pointer_v1* zwp_confined_pointer_v1 )
384{
385 wxLogTrace( traceWayland, wxS( "Pointer confined" ) );
386}
387
388static void unconfined_handler( void* data,
389 struct zwp_confined_pointer_v1* zwp_confined_pointer_v1 )
390{
391 wxLogTrace( traceWayland, wxS( "Pointer unconfined" ) );
392}
393
394static const struct zwp_confined_pointer_v1_listener confined_pointer_listener = {
395 .confined = confined_handler,
396 .unconfined = unconfined_handler
397};
398
399static void locked_handler( void* data, struct zwp_locked_pointer_v1* zwp_locked_pointer_v1 )
400{
401 s_wl_locked_flag = true;
402 wxLogTrace( traceWayland, wxS( "Pointer locked" ) );
403}
404
405static void unlocked_handler( void* data, struct zwp_locked_pointer_v1* zwp_locked_pointer_v1 )
406{
407 wxLogTrace( traceWayland, wxS( "Pointer unlocked" ) );
408}
409
410static const struct zwp_locked_pointer_v1_listener locked_pointer_listener = {
411 .locked = locked_handler,
412 .unlocked = unlocked_handler
413};
414
415
419static void initialize_wayland( wl_display* wldisp )
420{
421 if( s_wl_initialized )
422 {
423 return;
424 }
425
426 struct wl_registry* registry = wl_display_get_registry( wldisp );
427 wl_registry_add_listener( registry, &registry_listener, NULL );
428 wl_display_roundtrip( wldisp );
429 s_wl_initialized = true;
430}
431
432
433struct zwp_locked_pointer_v1* s_wl_locked_pointer = NULL;
434
435static int s_after_paint_handler_id = 0;
436
437static void on_frame_clock_after_paint( GdkFrameClock* clock, GtkWidget* widget )
438{
439 if( s_wl_locked_pointer )
440 {
441 zwp_locked_pointer_v1_destroy( s_wl_locked_pointer );
442 s_wl_locked_pointer = NULL;
443
444 wxLogTrace( traceWayland, wxS( "after-paint: locked_pointer destroyed" ) );
445
446 g_signal_handler_disconnect( (gpointer) clock, s_after_paint_handler_id );
447 s_after_paint_handler_id = 0;
448
449 // restore confinement
450 if( s_wl_confinement_region != NULL )
451 {
452 wxLogTrace( traceWayland, wxS( "after-paint: Restoring confinement" ) );
453
454 GdkDisplay* disp = gtk_widget_get_display( widget );
455 GdkSeat* seat = gdk_display_get_default_seat( disp );
456 GdkDevice* ptrdev = gdk_seat_get_pointer( seat );
457 GdkWindow* window = gtk_widget_get_window( widget );
458
459 wl_display* wldisp = gdk_wayland_display_get_wl_display( disp );
460 wl_surface* wlsurf = gdk_wayland_window_get_wl_surface( window );
461 wl_pointer* wlptr = gdk_wayland_device_get_wl_pointer( ptrdev );
462
463 s_wl_confined_pointer = zwp_pointer_constraints_v1_confine_pointer(
464 s_wl_pointer_constraints, wlsurf, wlptr, s_wl_confinement_region,
466
467 wl_display_roundtrip( wldisp );
468 }
469 }
470}
471
472
473static bool wayland_warp_pointer( GtkWidget* aWidget, GdkDisplay* aDisplay, GdkWindow* aWindow,
474 GdkDevice* aPtrDev, int aX, int aY )
475{
476 wl_display* wldisp = gdk_wayland_display_get_wl_display( aDisplay );
477 wl_surface* wlsurf = gdk_wayland_window_get_wl_surface( aWindow );
478 wl_pointer* wlptr = gdk_wayland_device_get_wl_pointer( aPtrDev );
479
480 if( s_after_paint_handler_id )
481 {
482 // Previous paint not done yet
483 wxLogTrace( traceWayland, wxS( "Not warping: after-paint pending" ) );
484 return false;
485 }
486
487 initialize_wayland( wldisp );
488
489 if( s_wl_locked_pointer )
490 {
491 // This shouldn't happen but let's be safe
492 wxLogTrace( traceWayland, wxS( "** Destroying previous locked_pointer **" ) );
493 zwp_locked_pointer_v1_destroy( s_wl_locked_pointer );
494 wl_display_roundtrip( wldisp );
495 s_wl_locked_pointer = NULL;
496 }
497
498 // wl_surface_commit causes an assert on GNOME, but has to be called on KDE
499 // before destroying the locked pointer, so wait until GDK commits the surface.
500 GdkFrameClock* frame_clock = gdk_window_get_frame_clock( aWindow );
501 s_after_paint_handler_id = g_signal_connect_after(
502 frame_clock, "after-paint", G_CALLBACK( on_frame_clock_after_paint ), aWidget );
503
504 // temporary disable confinement to allow pointer warping
505 if( s_wl_confinement_region && s_wl_confined_pointer )
506 {
507 zwp_confined_pointer_v1_destroy( s_wl_confined_pointer );
508 wl_display_roundtrip( wldisp );
509 s_wl_confined_pointer = NULL;
510 }
511
512 s_wl_locked_flag = false;
513
514 s_wl_locked_pointer =
515 zwp_pointer_constraints_v1_lock_pointer( s_wl_pointer_constraints, wlsurf, wlptr, NULL,
517
518 zwp_locked_pointer_v1_add_listener(s_wl_locked_pointer, &locked_pointer_listener, NULL);
519
520 gint wx, wy;
521 gtk_widget_translate_coordinates( aWidget, gtk_widget_get_toplevel( aWidget ), 0, 0, &wx, &wy );
522
523 zwp_locked_pointer_v1_set_cursor_position_hint( s_wl_locked_pointer, wl_fixed_from_int( aX + wx ),
524 wl_fixed_from_int( aY + wy ) );
525
526 // Don't call wl_surface_commit, wait for GDK because of an assert on GNOME.
527 wl_display_roundtrip( wldisp ); // To receive "locked" event.
528 gtk_widget_queue_draw( aWidget ); // Needed on some GNOME environment to trigger
529 // the "after-paint" event handler.
530
531 return s_wl_locked_flag;
532}
533
534
535bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow )
536{
537 wxLogTrace( traceWayland, wxS( "InfiniteDragPrepareWindow" ) );
538
539 GtkWidget* widget = static_cast<GtkWidget*>( aWindow->GetHandle() );
540 GdkDisplay* disp = gtk_widget_get_display( widget );
541
542 if( GDK_IS_WAYLAND_DISPLAY( disp ) )
543 {
544 if( s_wl_confined_pointer != NULL )
545 {
547 }
548
549 GdkSeat* seat = gdk_display_get_default_seat( disp );
550 GdkDevice* ptrdev = gdk_seat_get_pointer( seat );
551 GdkWindow* win = aWindow->GTKGetDrawingWindow();
552
553 wl_display* wldisp = gdk_wayland_display_get_wl_display( disp );
554 wl_surface* wlsurf = gdk_wayland_window_get_wl_surface( win );
555 wl_pointer* wlptr = gdk_wayland_device_get_wl_pointer( ptrdev );
556
557 initialize_wayland( wldisp );
558
559 gint x, y, width, height;
560 gdk_window_get_geometry( gdk_window_get_toplevel( win ), &x, &y, &width, &height );
561
562 wxLogTrace( traceWayland, wxS( "Confine region: %d %d %d %d" ), x, y, width, height );
563
564 s_wl_confinement_region = wl_compositor_create_region( s_wl_compositor );
565 wl_region_add( s_wl_confinement_region, x, y, width, height );
566
567 s_wl_confined_pointer = zwp_pointer_constraints_v1_confine_pointer(
568 s_wl_pointer_constraints, wlsurf, wlptr, s_wl_confinement_region,
570
571 zwp_confined_pointer_v1_add_listener( s_wl_confined_pointer, &confined_pointer_listener,
572 NULL );
573
574 wl_display_roundtrip( wldisp );
575 }
576 else if( wxGetEnv( wxT( "WAYLAND_DISPLAY" ), nullptr ) )
577 {
578 // Not working under XWayland
579 return false;
580 }
581
582 return true;
583};
584
585
587{
588 wxLogTrace( traceWayland, wxS( "InfiniteDragReleaseWindow" ) );
589
590 if( s_wl_confined_pointer )
591 {
592 zwp_confined_pointer_v1_destroy( s_wl_confined_pointer );
593 s_wl_confined_pointer = NULL;
594 }
595
596 if( s_wl_confinement_region )
597 {
598 wl_region_destroy( s_wl_confinement_region );
599 s_wl_confinement_region = NULL;
600 }
601};
602
603
604#else // No Wayland support
605
606
608{
609 // Not working under XWayland
610 return !wxGetEnv( wxT( "WAYLAND_DISPLAY" ), nullptr );
611};
612
613
615{
616 // Not needed on X11
617};
618
619
621{
622 return wxGetMousePosition();
623}
624#endif
const char * name
Definition: DXF_plotter.cpp:57
static void zwp_confined_pointer_v1_destroy(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1)
Destroy the confined pointer object.
static int zwp_confined_pointer_v1_add_listener(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1, const struct zwp_confined_pointer_v1_listener *listener, void *data)
static void zwp_locked_pointer_v1_set_cursor_position_hint(struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1, wl_fixed_t surface_x, wl_fixed_t surface_y)
Set the cursor position hint relative to the top left corner of the surface.
static int zwp_locked_pointer_v1_add_listener(struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1, const struct zwp_locked_pointer_v1_listener *listener, void *data)
static void zwp_locked_pointer_v1_destroy(struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1)
Destroy the locked pointer object.
static struct zwp_locked_pointer_v1 * zwp_pointer_constraints_v1_lock_pointer(struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1, struct wl_surface *surface, struct wl_pointer *pointer, struct wl_region *region, uint32_t lifetime)
The lock_pointer request lets the client request to disable movements of the virtual pointer (i....
static struct zwp_confined_pointer_v1 * zwp_pointer_constraints_v1_confine_pointer(struct zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1, struct wl_surface *surface, struct wl_pointer *pointer, struct wl_region *region, uint32_t lifetime)
The confine_pointer request lets the client request to confine the pointer cursor to a given region.
@ ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT
the pointer constraint is defunct once deactivated
bool AllowIconsInMenus()
If the user has disabled icons system-wide, we check that here.
Definition: wxgtk/ui.cpp:209
void SetFloatLevel(wxWindow *aWindow)
Intended to set the floating window level in macOS on a window.
Definition: wxgtk/ui.cpp:338
void EllipsizeChoiceBox(wxChoice *aChoice)
Configure a wxChoice control to ellipsize the shown text in the button with the ellipses placed at th...
Definition: wxgtk/ui.cpp:154
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: wxgtk/ui.cpp:94
void SetOverlayScrolling(const wxWindow *aWindow, bool overlay)
Used to set overlay/non-overlay scrolling mode in a window.
Definition: wxgtk/ui.cpp:202
wxPoint GetMousePosition()
Returns the mouse position in screen coordinates.
Definition: wxgtk/ui.cpp:620
void ImmControl(wxWindow *aWindow, bool aEnable)
Configures the IME mode of a given control handle.
Definition: wxgtk/ui.cpp:319
double GetPixelScaleFactor(const wxWindow *aWindow)
Tries to determine the pixel scaling factor currently in use for the window.
Definition: wxgtk/ui.cpp:175
void InfiniteDragReleaseWindow()
On Wayland, allows the cursor to freely move again after a drag (see InfiniteDragPrepareWindow).
Definition: wxgtk/ui.cpp:614
bool IsStockCursorOk(wxStockCursor aCursor)
Checks if we designated a stock cursor for this OS as "OK" or else we may need to load a custom one.
Definition: wxgtk/ui.cpp:100
double GetContentScaleFactor(const wxWindow *aWindow)
Tries to determine the content scaling factor currently in use for the window.
Definition: wxgtk/ui.cpp:188
void ImeNotifyCancelComposition(wxWindow *aWindow)
Asks the IME to cancel.
Definition: wxgtk/ui.cpp:324
void LargeChoiceBoxHack(wxChoice *aChoice)
Configure a wxChoice control to support a lot of entries by disabling functionality that makes adding...
Definition: wxgtk/ui.cpp:136
bool WarpPointer(wxWindow *aWindow, int aX, int aY)
Move the mouse cursor to a specific position relative to the window.
Definition: wxgtk/ui.cpp:253
wxColour GetDialogBGColour()
Definition: wxgtk/ui.cpp:61
bool IsWindowActive(wxWindow *aWindow)
Check to see if the given window is the currently active window (e.g.
Definition: wxgtk/ui.cpp:73
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: wxgtk/ui.cpp:195
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition: wxgtk/ui.cpp:67
bool InfiniteDragPrepareWindow(wxWindow *aWindow)
On Wayland, restricts the pointer movement to a rectangle slightly bigger than the given wxWindow.
Definition: wxgtk/ui.cpp:607
void ReparentModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: wxgtk/ui.cpp:88
bool IsDarkTheme()
Determine if the desktop interface is currently using a dark theme or a light theme.
Definition: wxgtk/ui.cpp:48
std::shared_ptr< PNS_LOG_VIEWER_OVERLAY > overlay
Definition: playground.cpp:46
void(* confined)(void *data, struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1)
pointer confined
void(* locked)(void *data, struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1)
lock activation event
const struct wl_interface zwp_pointer_constraints_v1_interface
static void disable_area_apply_attributes_cb(GtkWidget *pItem, gpointer userdata)
The following two functions are based on the "hack" contained in the attached patch at https://gitlab...
Definition: wxgtk/ui.cpp:123
const wxString traceWayland
Definition: wxgtk/ui.cpp:45