summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-06-23hw/xwin: Fix length of text property set by SelectionRequestsnapshotJon Turney1-1/+1
Fix the length of text property set by a SelectionRequest The length of the text property is not neccessarily the same as the length of the clipboard text before it is d2u converted (specifically, if that contains any '\r\n' sequences, it will be shorter as they are now just '\n')
2019-06-22Only convert WM_DESTROY into a WM_DELETE_WINDOW for unowned windowsJon Turney1-6/+10
winDestroyWindowsWindow() traverses the tree of child Windows windows, marking them as destroyed, but in the Windows world there is another class of windows which will get destroyed when another windows is: owned windows. We make top-level TRANSIENT_FOR windows owned (so they are minimized at the same time at their owner). There's no easy way to enumerate the owned windows of a Windows window. Instead, we avoid translating a WM_DESTROY into a WM_DELETE_WINDOW unless the window is unowned. I'm uncertain under what circumstances the kill here actually gets used. See https://cygwin.com/ml/cygwin/2019-06/msg00168.html In that case, we have a submenu which is TRANSIENT_FOR a menu, which is TRANSIENT_FOR the applications main window. When focus moves away, the menu is unmapped, destroying it's window, which causes the submenu to be also destroyed.
2019-06-17hw/xwin: Use BOOL type from Xmd.hclipboard-xcbificationJon Turney7-17/+17
This means we avoid all the issues with _XSERVER64 effecting how types are defined by Xdefs.h
2019-06-17hw/xwin: Remove XSetAuthorization() for helper clientsJon Turney9-37/+36
All helper client code now uses xcb, so calling XSetAuthorization() is no longer needed. This is the last reference to libX11 from helper clients, so linking with libX11 is no longer required. Also remove unneeded x11-xcb library from XWINMODULES Also drop installing these prerequistes on AppvVeyor Also move prototypes for functions in winauth.c from win.h into winauth.h, and include that where needed
2019-06-17hw/xwin: xcbify clipboard integrationJon Turney10-662/+483
Convert clipboard integration code from libX11 to xcb This drops support for COMPOUND_TEXT. Presumably some ancient (pre-2000) clients exist which support that, but not UTF8_STRING, but we don't have an example to test with. (Given the nature of the thing, the users of those clients probably work in CJK languages) Supporting COMPOUND_TEXT would also involve writing (or extracting from Xlib) support for the ISO 2022 encoding.
2019-06-15hw/xwin: Remove nounicodeclipboard optionJon Turney13-146/+49
Always use CF_UNICODETEXT clipboard format. Windows will automatically down-convert to CF_TEXT for clients which request that. This is subtly different in one way: if CF_TEXT is requested, we now post CF_UNICODETEXT and it is converted to CF_TEXT *in the locale of the requesting process*. Previously, we would convert to CF_TEXT *in our locale* and post that. Note that the !X_HAVE_UTF8_STRING case was utterly botched, but fortunately that has never been true...
2019-06-15Workaround for Add/RemoveClipboardListener missing from implibJon Turney1-2/+8
Add/RemoveClipboardListender are missing from the x86_64 user32 implib (as of MinGW-w64 w32api 5.0.4)
2019-06-15hw/xwin: Remove support for pre-Vista Win32 clipboard APIJon Turney5-199/+24
The original Win32 clipboard API is widely regarded as terrible, since it relies on clients co-operatively managing the clipboard viewer chain, and a single buggy client can break it for all other clients. The last Windows version only supporting that API was Windows XP (5.1), EOLed in 2014.
2019-06-01hw/xwin: Fix lingering uses of libX11 types and valuesJon Turney4-4/+5
2019-03-15appveyor: Update dependencies for xkbcomp-devel split from xkbcompJon Turney1-1/+1
2019-03-15Fix '-silent-dup-error -nolock'Jon Turney1-1/+2
2018-08-28hw/xwin: Respect -notrayicon option on taskbar restartColin Harrison1-1/+1
2018-08-28os: Use 64-bit tick count on WindowsJon Turney1-17/+16
On Windows, GetTickCount() returns a value that wraps after 49.7 days. Windows Vista and later offer GetTickCount64(), which does not have that issue. In places that can make use of more than 32 bits from the tick counter, use a 64-bit counter. Based on a patch by Jeff Smith <whydoubt@gmail.com> Also include Xwindows.h to make prototype available Unfortunately, the variable LockFile collides with a Win32 API function of the same name, so rename it slightly.
2018-08-28Add the Belgian (Comma) keyboard layoutColin Harrison1-0/+1
2018-08-28meson: Add dependencies for hw/xwin/ resource compilationJon Turney2-2/+4
Only has effect with meson >= 0.47.0
2018-08-28meson: use absolute paths in manpage substitutionsJon Turney1-3/+3
paths returned by get_option('foodir') are potentially relative to prefix
2018-08-28hw/xwin: Fix some more s/_/@/g in man pagesJon Turney2-2/+2
Not in 2e497bf8 because added by patches
2018-08-28meson: Correctly set Libs: in xorg-server.pc for WindowsJon Turney1-0/+7
c.f. configure.ac:1728
2018-05-13CI: Fix zlib -> zlib-devel in .appveyor.ymlJon Turney1-1/+1
2018-05-13meson: don't put a literal 'PACKAGE_STRING XORG_MAN_PAGE' in man pagesJon Turney1-2/+2
Instead, substitute the same values as autotools does
2018-05-13meson: don't install xorg wrapper manpages if suid-wrapper isn't being usedJon Turney1-11/+13
2018-05-13meson: Install xwinclip and Xwinrc man pagesJon Turney2-0/+14
Omitted from a1e8dc05
2018-05-13hw/xwin: Improve data returned for RANDR queriesJon Turney1-0/+15
Set a linear gamma ramp. This avoids the xrandr command always warning 'Failed to get size of gamma for output default' (perhaps we should be using GDI GetDeviceGammaRamp(), if possible?) Make CRTC report non-zero physical dimensions initially
2018-05-13hw/xwin: Always keep RANDR fake mode information up to dateJon Turney1-8/+14
The rrGetInfo hook is not called for all RANDR requests (e.g. RRGetOutputInfo), so we must always keep the fake mode information up to date, rather than doing it lazily in the rrGetInfo hook) Because we are so bad, most GTK+3 versions treat the output name 'default' specially, and don't try to use RANDR with it. But versions 3.21.6 to 3.22.24, don't do this, and get badly confused by a CRTC with size 0x0. See: https://bugzilla.gnome.org/show_bug.cgi?id=771033 https://bugzilla.gnome.org/show_bug.cgi?id=780101 Future work: Rather than reporting a single fake CRTC with a mode matching the entire virtual display, the fake CRTCs we report should match our 'pseudo-xinerama' monitors
2018-05-13Add Russian keyboard layoutColin Harrison1-0/+1
2018-05-13Correctly set renderType for fbConfigs for floating point pixelFormatsJon Turney1-15/+0
This looks some kind of merge error. Since "Add support for float format fbconfig GLX extensions", the renderType is set earlier, when we decode the pixel type.
2018-05-13Fix transposed RaiseVolume and LowerVolume scan codesJon Turney1-2/+2
2018-05-13Fix logging about WGL pxfs with overlaysJon Turney1-1/+1
2018-05-13Make QueryMonitor() slightly less insaneJon Turney4-26/+6
Also: Spamming the long UseMsg() after "Invalid monitor number" isn't very helpful.
2018-05-13Disable smart scheduler by default on CygwinJon Turney2-0/+10
The smart scheduler firing SIGALRM every 20ms causes problems on Cygwin. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2018-05-13Add an option to use alpha channel in multiwindow modeJon Turney8-3/+158
Add an option to turn on the use of the X windows alpha channel in multiwindow mode. This works on W7/Vista (using DwmEnableBlurBehindWindow()), and Windows 10 (using the undocumented SetWindowCompositionAttribute()), but not on Windows 8/8.1 -compositewm must be enabled for this to be useful, as the X window only uses a pixmap with an alpha channel when the Composite extensions is enabled. v2: Update meson.build Future work: A window property to control use of alpha? Option to turn off blur on W7/Vista Implement _NET_WM_WINDOW_OPACITY
2018-05-13Fix a warning when WGL_ARB_framebuffer_sRGB isn't availableJon Turney1-1/+4
Fix a bogus warning about a missing pixelformat attribute issued for every pixelformat when WGL_ARB_framebuffer_sRGB isn't available
2018-05-13Update X.org logo iconJon Turney5-2/+106
Generate icon from X.org logo SVG, rather than using a hand-crafted icon. This SVG has been tweaked to put a thin white border around the X, so it is visible on a black background. v2: Also generate from svg in meson.build Install ImageMagick in CI for convert tool XXX: compile_resources() lacks a depend: keyword to make it depend on the logo icon conversion. It's also not clear how the directory into which the output of the custom target is generated should be obtained to give to windres as an include directory.... See https://github.com/mesonbuild/meson/issues/2789
2018-05-13Improve performance of -compositewmJon Turney4-42/+290
I think that the major cost in the current implementation is doing a CreateDIBSection()/DestroyObject() on every refresh. So provide our own CreatePixmap() instead, which does the CreateDIBSection(), once. Testcase: glxgears or foobillard with direct swrast Testcase: scrolling in a full-screen xterm v2: Fix handling of RENDER Scratch Pixmaps (A problem easily shown with gitk or emacs)
2018-05-13hw/xwin: Remove mwextwmJon Turney22-3456/+20
This has always been described as 'experimental' This is pointless on x86_64 as xwinwm isn't packaged for it We don't think this is useful to anyone We don't test it Remove --enable-windowswm configure option Remove multiwindowextwm stuff from Makefiles Remove -mwextwm option Remove -mwextwm from man-page and help Un-ifdef XWIN_MULTIWINDOWEXTWM v2: Remove rootless include paths Remove windowswmproto from meson.build
2018-05-13Add -icon option to set the screen window icon in windowed modeJon Turney9-58/+129
Add an -icon option to set the screen window icon in windowed mode Allow cygwin paths in an icon-specification Update man pages and system.XWinrc appropriately Also, log an error if the icon specified for TRAYICON cannot be loaded Also, fix a bug in appending a '\' to IconDirectory only if it doesn't already end with one, which was fortunately benign. Also, if we are exiting in ddxProcessArgument() due to an error in options, use a non-zero exit status. XXX: LoadImageComma would be simpler if we just said that XWinrc paths are Cygwin paths on Cygwin, Windows paths on MinGW, but that could break existing .XWinrc files XXX: Given that we can specify paths, I'm not sure what IconDirectory wins us. v2: Fix formatting problems in man page additions
2018-05-13Use multisample attributes with wglChoosePixelFormatARB()Jon Turney1-0/+5
Seems like this was omitted in error
2018-05-13hw/xwin/glx: Add GLX_ARB_framebuffer_sRGB extensionJon Turney2-6/+24
2018-05-13hw/xwin/glx: publish GLX create_context extensionsJon Turney1-0/+4
XXX: To properly support GLX_ARB_create_context in indirect mode, we need to use wglCreateContextAttribsARB() rather than wglCreateContext(), when attribs are provided, rather than just dropping attribs on the floor, as we currently do. That probably entails removing the deferred context creation and instead using a temporary window, as direct WGL does.
2018-05-13hw/xwin/glx: Add support for float format fbconfig GLX extensionsJon Turney1-25/+65
2018-05-13hw/xwin/glx: Make WGL -> GLX extension mapping table-drivenJon Turney1-22/+32
2018-05-13Fix non-toplevel window resizing/repositioningJon Turney2-0/+25
Fix regressions in non-toplevel window resizing/repositioning introduced in "Avoid potential re-entrancy of xserver code in winPositionWindowMultiwindow" Avoid erroneous fall-through to top-level case in winAdjustWindowsWindow(). Implement WM_ASYNCMOVE for non-toplevel windows. These omissions caused non-toplevel WGL windows to not be resized correctly.
2018-05-13Fix custom sysmenu not used initiallyJon Turney3-7/+10
It seems we need to defer setting the custom sysmenu until after WS_SYSMENU style is applied?
2018-05-13Fix format warnings on x86Jon Turney7-24/+24
2018-05-13Avoid potential re-entrancy of xserver code in winPositionWindowMultiwindowJon Turney3-21/+39
Consider the following stack trace: 0 ConfigureWindow (pWin=pWin@entry=0x6004d40a0, mask=mask@entry=3, vlist=vlist@entry=0xffffb990, client=0x6004d31d0) at /usr/src/debug/xorg-server-1.18.1-1/dix/window.c:2199 1 0x0000000100415e13 in winAdjustXWindow (pWin=0x6004d40a0, hwnd=hwnd@entry=0x80490) at /usr/src/debug/xorg-server-1.18.1-1/hw/xwin/winmultiwindowwindow.c:1102 2 0x0000000100419eeb in winTopLevelWindowProc (hwnd=0x80490, message=<optimized out>, wParam=0, lParam=2197848832) at /usr/src/debug/xorg-server-1.18.1-1/hw/xwin/winmultiwindowwndproc.c:885 3 0x00007ffc8ae21169 in USER32!DispatchMessageW () from /cygdrive/c/WINDOWS/system32/USER32.dll 4 0x00007ffc8ae20ee2 in USER32!DispatchMessageW () from /cygdrive/c/WINDOWS/system32/USER32.dll 5 0x00007ffc8ae3098e in USER32!GetMenuItemInfoW () from /cygdrive/c/WINDOWS/system32/USER32.dll 6 0x00007ffc8b438b44 in ntdll!KiUserCallbackDispatcher () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll 7 0x00007ffc8ae41f94 in USER32!InvalidateRect () from /cygdrive/c/WINDOWS/system32/USER32.dll 8 0x00007ffc8ae207c5 in USER32!SendMessageW () from /cygdrive/c/WINDOWS/system32/USER32.dll 9 0x00007ffc8ae1e835 in USER32!GetWindowTextW () from /cygdrive/c/WINDOWS/system32/USER32.dll 10 0x00007ffc8ae24fbd in USER32!CallMsgFilterW () from /cygdrive/c/WINDOWS/system32/USER32.dll 11 0x00007ffc86347ced in UxTheme!CloseThemeData () from /cygdrive/c/WINDOWS/system32/uxtheme.dll 12 0x00007ffc8633566e in UxTheme!GetWindowTheme () from /cygdrive/c/WINDOWS/system32/uxtheme.dll 13 0x00007ffc8ae25062 in USER32!CallMsgFilterW () from /cygdrive/c/WINDOWS/system32/USER32.dll 14 0x0000000100419b16 in winTopLevelWindowProc (hwnd=0x80490, message=<optimized out>, wParam=0, lParam=4294952128) at /usr/src/debug/xorg-server-1.18.1-1/hw/xwin/winmultiwindowwndproc.c:1155 15 0x00007ffc8ae21169 in USER32!DispatchMessageW () from /cygdrive/c/WINDOWS/system32/USER32.dll 16 0x00007ffc8ae20ee2 in USER32!DispatchMessageW () from /cygdrive/c/WINDOWS/system32/USER32.dll 17 0x00007ffc8ae34d02 in UnionRect () from /cygdrive/c/WINDOWS/system32/USER32.dll 18 0x00007ffc8b438b44 in ntdll!KiUserCallbackDispatcher () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll 19 0x00007ffc8ae42a54 in USER32!MoveWindow () from /cygdrive/c/WINDOWS/system32/USER32.dll 20 0x00000001004154b0 in winPositionWindowMultiWindow (pWin=<optimized out>, x=<optimized out>, y=<optimized out>) at /usr/src/debug/xorg-server-1.18.1-1/hw/xwin/winmultiwindowwindow.c:333 21 0x00000001004e5649 in compPositionWindow (pWin=<optimized out>, x=<optimized out>, y=<optimized out>) at /usr/src/debug/xorg-server-1.18.1-1/composite/compwindow.c:247 22 0x000000010048b6e3 in miDbePositionWindow (pWin=0x6004d40a0, x=<optimized out>, y=<optimized out>) at /usr/src/debug/xorg-server-1.18.1-1/dbe/midbe.c:493 23 0x000000010056743a in miResizeWindow (pWin=0x6004d40a0, x=2110, y=243, w=<optimized out>, h=474, pSib=0x6004d3090) at /usr/src/debug/xorg-server-1.18.1-1/mi/miwindow.c:447 24 0x00000001004150d1 in winResizeWindowMultiWindow (pWin=<optimized out>, x=<optimized out>, y=<optimized out>, w=<optimized out>, h=474, pSib=0x6004d3090) at /usr/src/debug/xorg-server-1.18.1-1/hw/xwin/winmultiwindowwindow.c:1053 25 0x00000001004e53d1 in compResizeWindow (pWin=0x6004d40a0, x=<optimized out>, y=<optimized out>, w=<optimized out>, h=474, pSib=0x6004d3090) at /usr/src/debug/xorg-server-1.18.1-1/composite/compwindow.c:410 26 0x00000001005470f2 in ConfigureWindow (pWin=0x6004d40a0, mask=<optimized out>, vlist=vlist@entry=0x6004dda1c, client=client@entry=0x6004d31d0) at /usr/src/debug/xorg-server-1.18.1-1/dix/window.c:2422 27 0x0000000100515255 in ProcConfigureWindow (client=0x6004d31d0) at /usr/src/debug/xorg-server-1.18.1-1/dix/dispatch.c:868 28 0x000000010051a44f in Dispatch () at /usr/src/debug/xorg-server-1.18.1-1/dix/dispatch.c:430 29 0x000000010051e4f6 in dix_main (argc=3, argv=0xffffcc10, envp=<optimized out>) at /usr/src/debug/xorg-server-1.18.1-1/dix/main.c:300 30 0x00000001800484ad in _cygwin_exit_return () at /usr/src/debug/cygwin-2.4.1-1/winsup/cygwin/dcrt0.cc:1048 31 0x000000018004618c in _cygtls::call2 (this=0xffffce00, func=0x180047500 <dll_crt0_1(void*)>, arg=0x0, buf=buf@entry=0xffffcdf0) at /usr/src/debug/cygwin-2.4.1-1/winsup/cygwin/cygtls.cc:111 32 0x0000000180046224 in _cygtls::call (func=<optimized out>, arg=<optimized out>) at /usr/src/debug/cygwin-2.4.1-1/winsup/cygwin/cygtls.cc:30 winPositionWindowMultiWindow() calls MoveWindow(), which pumps the message queue to process the message(s) it sends, which calls winTopLevelWindowProc(), which can end up calling ConfigureWindow() again. ConfigureWindow() is not designed for re-entrancy. In particular, this will bypass any layers which are in the middle of an unwrapped call. It seems that composite handles this situation particularly badly, leading to the composite window position getting set incorrectly, which later leads to a crash as we try to access an area outside the window bitmap. Address this in this specific case by deferring the call to MoveWindow(), but I'm not sure there aren't other potential cases of this. The real solution is a different architecture.
2018-05-13Add logging which records if we are in an RDP sessionJon Turney2-0/+4
In an RDP session, the screen bpp will be set to the limited depth allowed for RDP sessions (16 bpp by default) This seems to sometimes cause problems with an X server started when the screen bpp was more, either because the bpp conversion introduces horrible dithering artefacts, or causes DirectDraw failures which we don't handle well Perhaps we should force engine 1 when started in a RDP session? Kind of a bodge and doesn't really solve the problem above.
2018-05-13Warn about too large Windows -> X clipboard pastesJon Turney1-0/+18
XChangeProperty() requests larger than the ~16MB permitted even with BigReq will fail BadLength
2018-05-13Implement INCR protocol for X clipboard -> Windows clipboardJon Turney5-221/+290
Also, relax the timeout mechanism so it allows 1 second between events, rather than 1 second for the entire transfer, as transfers of large pastes can take more than 1 second. Also, prefer UTF8_STRING encoding to COMPOUND_TEXT encoding
2018-05-13Fix a problem with initially maximized windowsJon Turney2-30/+46
Fix a problem which occurs when a window is initially maxmimized: It's shown unmaximized, then maximized. The initial unmaximized show causes a WM_WM_CHANGE_STATE to unmaximized to be sent, while a SW_MAXIMIZE is in flight. These overlapping in-flight messages can cause the window to get stuck flipping between maximized and unmaximized states. It seems that maximizing a Windows window is not a state, but an action which can only be applied to a visible window. So, this can't be fixed by maximizing the window before it is made visible. Instead, explicitly sequence things so the window is always initially shown unmaximized, then start tracking the state, and then maximize it.
2018-05-13Re-order window creation processJon Turney4-35/+61
Be a bit more careful to do things in the right order and set the style flags and window state before we show the window. This is probably the right thing to do in any case as it means we can avoid the messy appearance of the window changing style just after it is first shown This is achieved by having WM_CREATE send a WM_WM_CREATE message to our window manager thread, which then does all the work of discovering the windows style. Note that this subtly changes the semantics of winCreateWindowsWindow(): previously the window was visible and drawn before that function returned, now that happens asychronously; I'm not sure if that could cause problems or not...