diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-02-22 18:01:04 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-02-22 18:01:04 +0000 |
commit | 8f72f7ae85ccb8a59789d0bdd03501b45b6e5553 (patch) | |
tree | a106aed6b726ceb910aeeb1f5275e0a5dc385474 | |
parent | 6c2ed1dea3f3c935c67d53d17be9da82506f97b0 (diff) | |
parent | ab1652e62eaad26169a290f0f233091588b307d8 (diff) |
Merge branch 'cygwin-patches-for-1.11' into cygwin-release-1.11xserver-cygwin-1.11.4-4
-rw-r--r-- | hw/xwin/win.h | 3 | ||||
-rw-r--r-- | hw/xwin/winclipboard.h | 1 | ||||
-rw-r--r-- | hw/xwin/winclipboardinit.c | 7 | ||||
-rwxr-xr-x | hw/xwin/winclipboardwndproc.c | 26 | ||||
-rw-r--r-- | hw/xwin/winwndproc.c | 6 | ||||
-rw-r--r-- | man/Xserver.man | 3 | ||||
-rw-r--r-- | os/osinit.c | 37 |
7 files changed, 43 insertions, 40 deletions
diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 3522ee4f8..1ffef273f 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -825,6 +825,9 @@ winInitClipboard (void); void winFixClipboardChain (void); + +void +winUpdateClipboard (void); #endif diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h index 6f1616359..c51988bb9 100644 --- a/hw/xwin/winclipboard.h +++ b/hw/xwin/winclipboard.h @@ -74,6 +74,7 @@ #define WIN_CLIPBOARD_DELAY 1 #define WM_WM_REINIT (WM_USER + 1) +#define WM_WM_DEINIT (WM_USER + 2) /* * References to external symbols diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c index 1cbc27a2b..da8a9b753 100644 --- a/hw/xwin/winclipboardinit.c +++ b/hw/xwin/winclipboardinit.c @@ -143,3 +143,10 @@ winFixClipboardChain (void) PostMessage (g_hwndClipboard, WM_WM_REINIT, 0, 0); } } + +void +winUpdateClipboard (void) +{ + if (g_fClipboard && g_hwndClipboard) + PostMessage (g_hwndClipboard, WM_WM_DEINIT, 0, 0); +} diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c index 02347ff43..40bdaa978 100755 --- a/hw/xwin/winclipboardwndproc.c +++ b/hw/xwin/winclipboardwndproc.c @@ -246,6 +246,32 @@ winClipboardWindowProc (HWND hwnd, UINT message, winDebug ("winClipboardWindowProc - WM_WM_REINIT: Exit\n"); return 0; + case WM_WM_DEINIT: + { + /* + Assume the user has changed the selection since we gained + focus, so empty the Windows clipboard, to tell Windows that + it needs to ask us to render the contents again if anyone asks + for it + */ + + /* Set up for another delayed rendering callback */ + OpenClipboard (hwnd); + + /* Take ownership of the Windows clipboard */ + EmptyClipboard (); + + /* Advertise Unicode if we support it */ + if (g_fUnicodeSupport) + SetClipboardData (CF_UNICODETEXT, NULL); + + /* Always advertise regular text */ + SetClipboardData (CF_TEXT, NULL); + + /* Release the clipboard */ + CloseClipboard (); + } + return 0; case WM_DRAWCLIPBOARD: { diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index e99697de8..23d5454b0 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -1217,6 +1217,12 @@ winWindowProc (HWND hwnd, UINT message, #ifdef XWIN_CLIPBOARD /* Make sure the clipboard chain is ok. */ winFixClipboardChain (); + + if (!wParam) + { + /* Make sure clipboard is updated if needed */ + winUpdateClipboard (); + } #endif /* Call engine specific screen activation/deactivation function */ diff --git a/man/Xserver.man b/man/Xserver.man index fe248b6b3..cea131d0f 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -551,9 +551,6 @@ Outline font directories .I /tmp/.X11-unix/X\fBn\fP Unix domain socket for display number \fBn\fP .TP 30 -.I /usr/adm/X\fBn\fPmsgs -Error log file for display number \fBn\fP if run from \fIinit\fP(__adminmansuffix__) -.TP 30 .I __projectroot__/lib/X11/xdm/xdm-errors Default error log file if the server is run from \fIxdm\fP(1) .SH "SEE ALSO" diff --git a/os/osinit.c b/os/osinit.c index 0cb82cca7..c4dfc5d40 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -72,10 +72,6 @@ SOFTWARE. #include <sys/resource.h> #endif -#ifndef ADMPATH -#define ADMPATH "/usr/adm/X%smsgs" -#endif - extern char *display; #ifdef RLIMIT_DATA int limitDataSpace = -1; @@ -203,39 +199,6 @@ OsInit(void) fclose(stdin); fclose(stdout); #endif - /* - * If a write of zero bytes to stderr returns non-zero, i.e. -1, - * then writing to stderr failed, and we'll write somewhere else - * instead. (Apparently this never happens in the Real World.) - */ - if (write (2, fname, 0) == -1) - { - FILE *err; - - if ((display) && (strlen (display) + strlen (ADMPATH) + 1 < sizeof fname)) - sprintf (fname, ADMPATH, display); - else - strcpy (fname, devnull); - /* - * uses stdio to avoid os dependencies here, - * a real os would use - * open (fname, O_WRONLY|O_APPEND|O_CREAT, 0666) - */ - if (!(err = fopen (fname, "a+"))) - err = fopen (devnull, "w"); - if (err && (fileno(err) != 2)) { - dup2 (fileno (err), 2); - fclose (err); - } -#if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__) - { - static char buf[BUFSIZ]; - setvbuf (stderr, buf, _IOLBF, BUFSIZ); - } -#else - setlinebuf(stderr); -#endif - } if (getpgrp () == 0) setpgid (0, 0); |