Merge branch 'origin' into input-hotplug

This commit is contained in:
Daniel Stone 2006-08-18 17:05:50 +03:00 committed by Daniel Stone
commit 1c2cb30cd8
5 changed files with 113 additions and 85 deletions

View File

@ -87,6 +87,9 @@ static char *DFLT_MOUSE_DEV = "/dev/devi/mouse0";
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
static char *DFLT_MOUSE_PROTO = "auto";
#elif defined(linux)
static char DFLT_MOUSE_DEV[] = "/dev/input/mice";
static char DFLT_MOUSE_PROTO[] = "auto";
#else
static char *DFLT_MOUSE_DEV = "/dev/mouse";
static char *DFLT_MOUSE_PROTO = "auto";

View File

@ -47,6 +47,22 @@
#include "xf86Priv.h"
#include "xf86DDC.h"
static void
printModeRejectMessage(int index, DisplayModePtr p, int status)
{
char *type;
if (p->type & M_T_BUILTIN)
type = "built-in ";
else if (p->type & M_T_DEFAULT)
type = "default ";
else
type = "";
xf86DrvMsg(index, X_INFO, "Not using %smode \"%s\" (%s)\n", type, p->name,
xf86ModeStatusToString(status));
}
/*
* xf86GetNearestClock --
* Find closest clock to given frequency (in kHz). This assumes the
@ -1644,18 +1660,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
q->name = xnfstrdup(p->name);
q->status = MODE_OK;
} else {
if (p->type & M_T_BUILTIN)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using built-in mode \"%s\" (%s)\n",
p->name, xf86ModeStatusToString(status));
else if (p->type & M_T_DEFAULT)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using default mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(status));
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(status));
printModeRejectMessage(scrp->scrnIndex, p, status);
}
}
@ -1796,39 +1801,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
repeat = FALSE;
lookupNext:
if (repeat && ((status = p->status) != MODE_OK)) {
if (p->type & M_T_BUILTIN)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using built-in mode \"%s\" (%s)\n",
p->name, xf86ModeStatusToString(status));
else if (p->type & M_T_DEFAULT)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using default mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(status));
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(status));
}
if (repeat && ((status = p->status) != MODE_OK))
printModeRejectMessage(scrp->scrnIndex, p, status);
saveType = p->type;
status = xf86LookupMode(scrp, p, clockRanges, strategy);
if (repeat && status == MODE_NOMODE) {
if (repeat && status == MODE_NOMODE)
continue;
}
if (status != MODE_OK) {
if (p->type & M_T_BUILTIN)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using built-in mode \"%s\" (%s)\n",
p->name, xf86ModeStatusToString(status));
else if (p->type & M_T_DEFAULT)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using default mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(status));
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(status));
}
if (status != MODE_OK)
printModeRejectMessage(scrp->scrnIndex, p, status);
if (status == MODE_ERROR) {
ErrorF("xf86ValidateModes: "
"unexpected result from xf86LookupMode()\n");
@ -2023,20 +2003,6 @@ xf86PruneDriverModes(ScrnInfoPtr scrp)
return;
n = p->next;
if (p->status != MODE_OK) {
#if 0
if (p->type & M_T_BUILTIN)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using built-in mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(p->status));
else if (p->type & M_T_DEFAULT)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using default mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(p->status));
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Not using mode \"%s\" (%s)\n", p->name,
xf86ModeStatusToString(p->status));
#endif
xf86DeleteMode(&(scrp->modes), p);
}
p = n;

View File

@ -56,6 +56,8 @@ extern void *g_pClipboardDisplay;
extern Window g_iClipboardWindow;
extern Atom g_atomLastOwnedSelection;
/* BPS - g_hwndClipboard needed for X app->Windows paste fix */
extern HWND g_hwndClipboard;
/*
* Local function prototypes
@ -141,6 +143,12 @@ winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay,
* Process a given Windows message
*/
/* BPS - Define our own message, which we'll post to ourselves to facilitate
* resetting the delayed rendering mechanism after each paste from X app to
* Windows app. TODO - Perhaps move to win.h with the other WM_USER messages.
*/
#define WM_USER_PASTE_COMPLETE (WM_USER + 1003)
LRESULT CALLBACK
winClipboardWindowProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
@ -167,16 +175,19 @@ winClipboardWindowProc (HWND hwnd, UINT message,
case WM_CREATE:
{
HWND first, next;
DWORD error_code = 0;
winDebug ("winClipboardWindowProc - WM_CREATE\n");
first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
if (first == hwnd) return 0; /* Make sure it's not us! */
/* Add ourselves to the clipboard viewer chain */
s_hwndNextViewer = SetClipboardViewer (hwnd);
if (s_hwndNextViewer == hwnd)
{
s_hwndNextViewer = NULL;
winErrorFVerb (1, "winClipboardWindowProc - WM_CREATE: "
"attempted to set next window to ourselves.");
}
next = SetClipboardViewer (hwnd);
error_code = GetLastError();
if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */
s_hwndNextViewer = next; /* it returned must have been the first window in the chain */
else
s_fCBCInitialized = FALSE;
}
return 0;
@ -220,28 +231,27 @@ winClipboardWindowProc (HWND hwnd, UINT message,
* expensive than just putting ourselves back into the chain.
*/
HWND first, next;
DWORD error_code = 0;
winDebug ("winClipboardWindowProc - WM_WM_REINIT: Enter\n");
if (hwnd != GetClipboardViewer ())
{
winDebug (" WM_WM_REINIT: Replacing us(%x) with %x at head "
"of chain\n", hwnd, s_hwndNextViewer);
s_fCBCInitialized = FALSE;
ChangeClipboardChain (hwnd, s_hwndNextViewer);
s_hwndNextViewer = NULL;
s_fCBCInitialized = FALSE;
winDebug (" WM_WM_REINIT: Putting us back at head of chain.\n");
s_hwndNextViewer = SetClipboardViewer (hwnd);
if (s_hwndNextViewer == hwnd)
{
s_hwndNextViewer = NULL;
winErrorFVerb (1, "winClipboardWindowProc - WM_WM_REINIT: "
"attempted to set next window to ourselves.\n");
}
}
first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
if (first == hwnd) return 0; /* Make sure it's not us! */
winDebug (" WM_WM_REINIT: Replacing us(%x) with %x at head "
"of chain\n", hwnd, s_hwndNextViewer);
s_fCBCInitialized = FALSE;
ChangeClipboardChain (hwnd, s_hwndNextViewer);
s_hwndNextViewer = NULL;
s_fCBCInitialized = FALSE;
winDebug (" WM_WM_REINIT: Putting us back at head of chain.\n");
first = GetClipboardViewer(); /* Get handle to first viewer in chain. */
if (first == hwnd) return 0; /* Make sure it's not us! */
next = SetClipboardViewer (hwnd);
error_code = GetLastError();
if (SUCCEEDED(error_code) && (next == first)) /* SetClipboardViewer must have succeeded, and the handle */
s_hwndNextViewer = next; /* it returned must have been the first window in the chain */
else
{
winDebug (" WM_WM_REINIT: already at head of viewer chain.\n");
}
s_fCBCInitialized = FALSE;
}
winDebug ("winClipboardWindowProc - WM_WM_REINIT: Exit\n");
return 0;
@ -325,8 +335,6 @@ winClipboardWindowProc (HWND hwnd, UINT message,
* previous XSetSelectionOwner messages.
*/
XSync (pDisplay, FALSE);
winDebug("winClipboardWindowProc - XSync done.\n");
/* Release PRIMARY selection if owned */
iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY);
@ -525,6 +533,13 @@ winClipboardWindowProc (HWND hwnd, UINT message,
SetClipboardData (CF_TEXT, NULL);
}
/* BPS - Post ourselves a user message whose handler will reset the
* delayed rendering mechanism after the paste is complete. This is
* necessary because calling SetClipboardData() with a NULL argument
* here will cause the data we just put on the clipboard to be lost!
*/
PostMessage(g_hwndClipboard, WM_USER_PASTE_COMPLETE, 0, 0);
/* Special handling for WM_RENDERALLFORMATS */
if (message == WM_RENDERALLFORMATS)
{
@ -542,6 +557,37 @@ winClipboardWindowProc (HWND hwnd, UINT message,
winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n");
return 0;
}
/* BPS - This WM_USER message is posted by us. It gives us the opportunity
* to reset the delayed rendering mechanism after each and every paste
* from an X app to a Windows app. Without such a mechanism, subsequent
* changes of selection in the X app owning the selection are not
* reflected in pastes into Windows apps, since Windows won't send us the
* WM_RENDERFORMAT message unless someone has set changed data (or NULL)
* on the clipboard. */
case WM_USER_PASTE_COMPLETE:
{
if (hwnd != GetClipboardOwner ())
/* In case we've lost the selection since posting the message */
return 0;
winDebug ("winClipboardWindowProc - WM_USER_PASTE_COMPLETE\n");
/* Set up for another delayed rendering callback */
OpenClipboard (g_hwndClipboard);
/* 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;
}
/* Let Windows perform default processing for unhandled messages */

View File

@ -394,6 +394,15 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
* currently being created.
*/
winReorderWindowsMultiWindow ();
/* Fix a 'round title bar corner background should be transparent not black' problem when first painted */
RECT rWindow;
HRGN hRgnWindow;
GetWindowRect(hwnd, &rWindow);
hRgnWindow = CreateRectRgnIndirect(&rWindow);
SetWindowRgn (hwnd, hRgnWindow, TRUE);
DeleteObject(hRgnWindow);
return 0;
case WM_INIT_SYS_MENU:

View File

@ -1188,7 +1188,11 @@ ResetHosts (char *display)
FreeHost (host);
}
#if defined WIN32 && defined __MINGW32__
#define ETC_HOST_PREFIX "X"
#else
#define ETC_HOST_PREFIX "/etc/X"
#endif
#define ETC_HOST_SUFFIX ".hosts"
fnamelen = strlen(ETC_HOST_PREFIX) + strlen(ETC_HOST_SUFFIX) +
strlen(display) + 1;