WINGs: guard WMRegisterViewForDraggedTypes against NULL X display

In Wayland mode the X11 display is NULL. WMCreateColorWell calls
WMRegisterViewForDraggedTypes which calls XInternAtom, crashing.
Bail early when display is NULL since X11 DnD is not available.
This commit is contained in:
Window Maker 2026-05-25 13:07:55 +02:00
parent d5bc733842
commit 2aeb76971a
2 changed files with 20 additions and 0 deletions

View File

@ -863,6 +863,12 @@ void WMRegisterViewForDraggedTypes(WMView * view, WMArray * acceptedTypes)
int typeCount;
int i;
if (!W_VIEW_SCREEN(view)->display) {
/* Wayland mode: no X11 DnD support */
(void)acceptedTypes;
return;
}
typeCount = WMGetArrayItemCount(acceptedTypes);
types = wmalloc(sizeof(WMNativeAtom) * (typeCount + 1));

14
wprefs.log Normal file
View File

@ -0,0 +1,14 @@
=== WPrefs CRASH ===
signal 11
WPrefs(+0xe13a) [0x55555556213a]
/usr/lib64/libc.so.6(+0x3d520) [0x7ffff732e520]
/usr/lib64/libX11.so.6(XInternAtom+0x2c) [0x7ffff76067ac]
/usr/local/lib/libWINGs.so.3(WMRegisterViewForDraggedTypes+0x5b) [0x7ffff7f90c7b]
/usr/local/lib/libWINGs.so.3(WMCreateColorWell+0x16e) [0x7ffff7f6a5ce]
WPrefs(+0x13656) [0x555555567656]
WPrefs(+0xe2e6) [0x5555555622e6]
/usr/local/lib/libWINGs.so.3(WMHandleEvent+0x132) [0x7ffff7f6ac52]
WPrefs(+0xdf36) [0x555555561f36]
/usr/lib64/libc.so.6(+0x273fb) [0x7ffff73183fb]
/usr/lib64/libc.so.6(__libc_start_main+0x8b) [0x7ffff73184ab]
WPrefs(+0xe015) [0x555555562015]