xserver/hw/xwin
Jon TURNEY 527cf13135 hw/xwin: Make winOverrideIcon() thread-safe for icon data access
winOverrideIcon() is called from the internal WM client thread.

Accessing server-internal data structures to get icon data or window hints is
not safe, as there is no lock to ensure we do not collide with these data
structures being updated in the server thread.

Rewrite so the internal client thread uses X client calls to obtain this data
safely

We used to also set the icon inside the server when the window was initially
created.  For simplicity, we simply send a message to the internal WM to update
the icon when the window is created (rather than writing different icon update
code which can work in the server thread for that one case...)

extwm mode used to do the icon update in the server. I'm not sure that actually
made much sense.  Let's assume the external WM client can do it instead...

v2
Make sure that WM_WM_ICON_EVENT does nothing for override-redirect windows

v3
Reinstate check that native window actually has expected properties for an X
window before trying to update it's icon; some auxiliary windows owned by the
XWin process don't, which would cause a crash

v4
Various fixes to pixmap icon conversion:
- remove left-over malloc in winScaleXimageToWindowsIcon causing a memory leak
- don't recalculate DDBitmap stride in winScaleXimageToWindowsIcon, when we already have worked it out
- properly check that XGetWindowProperty(NET_WM_ICON) returned some data
- don't try to retrieve WM_HINTS icon_mask if it isn't set
- restore accidentally dropped calculation of effBpp, stride, maskStride of output DDBitmap
- make sure imageMask is zero-initalized before we use it to mask the DDBitmap

v5
Remove a left-over unused variable

v6
Avoid XDestroyImage(NULL) crash if XGetImage failed for icon_pixmap

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:47:42 +01:00
..
glx hw/xwin/glx: Fix glxWinCreateContext() function pointer mismatch 2012-06-21 19:52:44 +01:00
man hw/xwin: Refer to xkeyboard-config man page for XKB configuration option values 2012-07-16 13:59:40 +01:00
.gitignore XWin: build XWin man pages using XORG_MANPAGE_SECTIONS 2011-01-18 15:10:21 -08:00
InitInput.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
InitOutput.c Restore GLX extension to XWin 2012-07-12 17:48:06 +01:00
Makefile.am hw/xwin: Remove winClipboardDetectUnicodeSupport() 2012-07-16 13:56:31 +01:00
X.ico Cygwin/X: Update the native icon to one based on the X.Org logo 2008-12-15 12:42:10 +00:00
XWin.exe.manifest Cygwin/X: Make default DPI match native DPI 2011-11-02 13:56:22 +00:00
XWin.rc Cygwin/X: Left-justify website link in About box 2011-06-29 19:14:38 +01:00
ddraw.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
system.XWinrc Cygwin/X: Tidy up system.Xwinrc 2010-02-05 19:15:04 +00:00
win.h hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winallpriv.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winblock.c hw/xwin: Tidy up some pointless output which is always emitted 2012-07-16 13:52:37 +01:00
winclip.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winclipboard.h hw/xwin: Remove winClipboardDetectUnicodeSupport() 2012-07-16 13:56:31 +01:00
winclipboardinit.c hw/xwin: Tidy up some pointless output which is always emitted 2012-07-16 13:52:37 +01:00
winclipboardtextconv.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winclipboardthread.c hw/xwin: Remove winClipboardDetectUnicodeSupport() 2012-07-16 13:56:31 +01:00
winclipboardwndproc.c hw/xwin: Remove winClipboardDetectUnicodeSupport() 2012-07-16 13:56:31 +01:00
winclipboardwrappers.c hw/xwin: Remove winClipboardDetectUnicodeSupport() 2012-07-16 13:56:31 +01:00
winclipboardxevents.c hw/xwin: Remove winClipboardDetectUnicodeSupport() 2012-07-16 13:56:31 +01:00
wincmap.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winconfig.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winconfig.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
wincreatewnd.c hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor 2012-07-16 13:54:15 +01:00
wincursor.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
windialogs.c hw/xwin: Tidy up some more pointless output which is always emitted 2012-07-16 13:55:02 +01:00
winengine.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winerror.c hw/xwin: Don't bother reporting XORG_VERSION_CURRENT 2012-07-16 13:51:58 +01:00
winfillsp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winfont.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
wingc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
wingetsp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winglobals.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winglobals.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winkeybd.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winkeybd.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winkeyhook.c hw/xwin: Remove a pointless OS version check in winInstallKeyboardHookLL() 2012-07-16 13:56:54 +01:00
winkeynames.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winlayouts.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmessages.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmisc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmonitors.c hw/xwin: Fix command line arguments for multiple monitors. 2012-07-16 13:59:29 +01:00
winmonitors.h hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor 2012-07-16 13:54:15 +01:00
winmouse.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winms.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmsg.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmsg.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmultiwindowclass.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmultiwindowclass.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmultiwindowicons.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winmultiwindowicons.h hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winmultiwindowshape.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmultiwindowwindow.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winmultiwindowwm.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winmultiwindowwndproc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winnativegdi.c api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
winpfbdd.c api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
winpixmap.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winpolyline.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winprefs.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winprefs.h hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winprefslex.l hw/xwin: Improve XWinrc loading and error recovery 2012-01-26 14:10:12 +00:00
winprefsyacc.y Cygwin/X: Avoid a collision between DEBUG and a token name 2010-02-05 19:21:19 +00:00
winprocarg.c hw/xwin: Correct function name in log message 2012-07-16 13:55:26 +01:00
winrandr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winregistry.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winresource.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winrop.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winscrinit.c hw/xwin: Tidy up some pointless output which is always emitted 2012-07-16 13:52:37 +01:00
winsetsp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winshaddd.c api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
winshadddnl.c api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
winshadgdi.c api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
wintrayicon.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winvalargs.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winvideo.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winwakeup.c xwin: fixup block/wakeup handlers 2012-06-05 13:02:38 -07:00
winwin32rootless.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winwin32rootlesswindow.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winwin32rootlesswndproc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winwindow.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winwindow.h hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winwindowswm.c hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winwndproc.c hw/xwin: RANDR resize didn't occur when screen window was maximized or restored 2012-07-16 13:54:39 +01:00