From 711d87aa472603a83f693dcfc41d08232db9ee8a Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 27 Apr 2014 22:10:31 +0100 Subject: Update .gitignore --- .gitignore | 1 + hw/xwin/glx/.gitignore | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 94a12fdc2..f8bdddbbb 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,4 @@ core doltcompile doltlibtool xserver.ent +test-driver diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore index 062fd8573..9684410ac 100644 --- a/hw/xwin/glx/.gitignore +++ b/hw/xwin/glx/.gitignore @@ -1,3 +1,6 @@ # ignore generated files -generated_gl_wrappers.c +diag.txt +generated_gl_shim.c +generated_gl_thunks.c +generated_gl_thunks.def generated_wgl_wrappers.c -- cgit v1.2.3 From 83aff839300564e754b363f88ceea8d9b3c8f15f Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 27 Apr 2014 22:18:52 +0100 Subject: Avoid "Your OS is unknown" warning when configuring Xorg for cygwin --- configure.ac | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ed650defa..8e4b543a7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,3 +1,4 @@ + dnl Copyright © 2003-2007 Keith Packard, Daniel Stone dnl dnl Permission is hereby granted, free of charge, to any person obtaining a @@ -1970,11 +1971,13 @@ if test "x$XORG" = xyes; then gnu*) XORG_OS_SUBDIR="hurd" ;; + cygwin*) + XORG_OS_SUBDIR="stub" + ;; *) XORG_OS_SUBDIR="stub" AC_MSG_NOTICE([m4_text_wrap(m4_join([ ], - [Your OS is unknown. Xorg currently only supports Linux,], - [Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.], + [Your OS is unknown.], [If you are interested in porting Xorg to your platform,], [please email xorg@lists.freedesktop.org.]))]) ;; -- cgit v1.2.3 From a7d1c2be40d5b9f5c51e03292a20f6e20503e335 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 27 Apr 2014 22:06:55 +0100 Subject: Fix sometimes missing sysmenu icon on Vista and later It seems that the way we create windows makes Vista display them initially without a sysmenu icon. If the application subsequently changes it's icon, all works well, but if the icon is set before the window is displayed and never changes, the window is shown without a sysmenu icon. Rearrange things to avoid this behaviour: Explicitly select default icons instead of assuming class icons will be used for a window created without the WS_SYSMENU style. It also seems we must send WM_SETICON to update the icon *after* we have updated style to include WS_SYSMENU in order for the icon to actually be used. Signed-off-by: Jon TURNEY --- hw/xwin/winmultiwindowicons.c | 34 ++++++++++++++++++++++------------ hw/xwin/winmultiwindowwm.c | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c index 4ac8bffdf..09b9b0412 100644 --- a/hw/xwin/winmultiwindowicons.c +++ b/hw/xwin/winmultiwindowicons.c @@ -70,23 +70,33 @@ winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew) hIcon = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXICON)); hIconSmall = winXIconToHICON(conn, id, GetSystemMetrics(SM_CXSMICON)); + + /* If we got the small, but not the large one swap them */ + if (!hIcon && hIconSmall) { + hIcon = hIconSmall; + hIconSmall = NULL; + } } - /* If we got the small, but not the large one swap them */ - if (!hIcon && hIconSmall) { - hIcon = hIconSmall; - hIconSmall = NULL; + /* If we still need an icon, use the default one */ + if (!hIcon) { + hIcon = g_hIconX; + hIconSmall = g_hSmallIconX; } - /* Set the large icon */ - hIconOld = (HICON) SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); - /* Delete the old icon if its not the default */ - winDestroyIcon(hIconOld); + if (hIcon) { + /* Set the large icon */ + hIconOld = (HICON) SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); + /* Delete the old icon if its not the default */ + winDestroyIcon(hIconOld); + } - /* Same for the small icon */ - hIconOld = - (HICON) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); - winDestroyIcon(hIconOld); + if (hIconSmall) { + /* Same for the small icon */ + hIconOld = + (HICON) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); + winDestroyIcon(hIconOld); + } } void diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index c9f0b304b..0510ca89a 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -865,8 +865,8 @@ winMultiWindowWMProc(void *pArg) PropModeReplace, (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4); UpdateName(pWMInfo, pNode->msg.iWindow); - UpdateIcon(pWMInfo, pNode->msg.iWindow); UpdateStyle(pWMInfo, pNode->msg.iWindow); + UpdateIcon(pWMInfo, pNode->msg.iWindow); /* Reshape */ -- cgit v1.2.3 From c61a08fa8df8811803dc896970c417da78b721e3 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 28 Apr 2014 12:48:15 +0100 Subject: Fix hang on shutdown when we own the clipboard. If we are the clipboard owner when we are shutdown, we recieve a WM_RENDERALLFORMATS. Unfortunately, it's far too late to do anything with this, as the server is waiting for the clipboard thread to exit, so can't process requests to convert clipboard contents. Change so we just do nothing on WM_RENDERALLFORMATS. (I'm not convinced that WM_RENDERALLFORMATS has ever worked usefully, in any case). (To make this work, I guess we would need to rearrange the way shutdown works completely: first synchronously stop the clipboard, then stop the X server) We also then receive a WM_DRAWCLIPBOARD, perhaps telling us that the available clipboard formats have changed (as ones which haven't been rendered are now removed), but the clipboard owner is now the system, not us, which we have to arrange to ignore. Also: add dependency of XWin on libXWinclipboard, so it gets relinked when it changes. --- hw/xwin/Makefile.am | 3 +- hw/xwin/winclipboard/wndproc.c | 70 +++++++++++++++--------------------------- 2 files changed, 27 insertions(+), 46 deletions(-) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index df920eb6d..1a97ca2f1 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -152,7 +152,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la -XWin_DEPENDENCIES = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) +XWin_DEPENDENCIES = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) \ + $(CLIPBOARD_LIBS) XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) \ $(CLIPBOARD_LIBS) $(XWIN_GLX_SYS_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) $(MULTIWINDOW_SYS_LIBS) XWin_LDFLAGS = -mwindows -Wl,--disable-stdcall-fixup $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c index 423dcade3..f0867f91d 100644 --- a/hw/xwin/winclipboard/wndproc.c +++ b/hw/xwin/winclipboard/wndproc.c @@ -143,6 +143,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static Display *pDisplay; static Window iWindow; static ClipboardAtoms *atoms; + static Bool fRunning; /* Branch on message type */ switch (message) { @@ -160,7 +161,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_WM_QUIT: { winDebug("winClipboardWindowProc - WM_WM_QUIT\n"); - + fRunning = FALSE; PostQuitMessage(0); } return 0; @@ -176,6 +177,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) pDisplay = cwcp->pClipboardDisplay; iWindow = cwcp->iClipboardWindow; atoms = cwcp->atoms; + fRunning = TRUE; first = GetClipboardViewer(); /* Get handle to first viewer in chain. */ if (first == hwnd) @@ -308,6 +310,10 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; } + /* Bail when shutting down */ + if (!fRunning) + return 0; + /* * Do not take ownership of the X11 selections when something * other than CF_TEXT or CF_UNICODETEXT has been copied @@ -441,24 +447,31 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winDebug("winClipboardWindowProc - WM_DESTROYCLIPBOARD - Ignored.\n"); return 0; - case WM_RENDERFORMAT: case WM_RENDERALLFORMATS: + winDebug("winClipboardWindowProc - WM_RENDERALLFORMATS - Hello.\n"); + + /* + WM_RENDERALLFORMATS is sent as we are shutting down, to render the + clipboard so it's contents remains available to other applications. + + Unfortunately, this can't work without major changes. The server is + already waiting for us to stop, so we can't ask for the rendering of + clipboard text now. + */ + + return 0; + + case WM_RENDERFORMAT: { int iReturn; Bool fConvertToUnicode; Bool pasted = FALSE; - if (message == WM_RENDERALLFORMATS) - winDebug("winClipboardWindowProc - WM_RENDERALLFORMATS - Hello.\n"); - else - winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n", - wParam); + winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n", + wParam); /* Flag whether to convert to Unicode or not */ - if (message == WM_RENDERALLFORMATS) - fConvertToUnicode = FALSE; - else - fConvertToUnicode = (CF_UNICODETEXT == wParam); + fConvertToUnicode = (CF_UNICODETEXT == wParam); Atom selection = winClipboardGetLastOwnedSelectionAtom(atoms); @@ -543,28 +556,6 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) atoms->atomLocalProperty, iWindow, CurrentTime); - /* Special handling for WM_RENDERALLFORMATS */ - if (message == WM_RENDERALLFORMATS) { - /* We must open and empty the clipboard */ - - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow() == hwnd) { - CloseClipboard(); - } - - if (!OpenClipboard(hwnd)) { - ErrorF("winClipboardWindowProc - WM_RENDER*FORMATS - " - "OpenClipboard () failed: %08x\n", - GetLastError()); - } - - if (!EmptyClipboard()) { - ErrorF("winClipboardWindowProc - WM_RENDER*FORMATS - " - "EmptyClipboard () failed: %08x\n", - GetLastError()); - } - } - /* Process X events */ iReturn = winProcessXEventsTimeout(hwnd, iWindow, @@ -598,18 +589,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetClipboardData(CF_TEXT, NULL); } - /* Special handling for WM_RENDERALLFORMATS */ - if (message == WM_RENDERALLFORMATS) { - /* We must close the clipboard */ - - if (!CloseClipboard()) { - ErrorF("winClipboardWindowProc - WM_RENDERALLFORMATS - " - "CloseClipboard () failed: %08x\n", - GetLastError()); - } - } - - winDebug("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n"); + winDebug("winClipboardWindowProc - WM_RENDERFORMAT - Returning.\n"); return 0; } } -- cgit v1.2.3