mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 12:18:09 +02:00
- transition from xoncygwin to xorg repository.
This commit is contained in:
parent
4e7ade29ed
commit
6e47ed58a1
30 changed files with 464 additions and 252 deletions
|
|
@ -57,6 +57,7 @@ int g_iLogVerbose = 4;
|
|||
char * g_pszLogFile = WIN_LOG_FNAME;
|
||||
Bool g_fLogInited = FALSE;
|
||||
const char * g_pszQueryHost = NULL;
|
||||
Bool g_fUnicodeClipboard = TRUE;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -69,7 +70,7 @@ FARPROC g_fpDirectDrawCreate = NULL;
|
|||
FARPROC g_fpDirectDrawCreateClipper = NULL;
|
||||
|
||||
HMODULE g_hmodCommonControls = NULL;
|
||||
FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
|
||||
FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
|
@ -77,6 +78,7 @@ FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
|
|||
#ifdef DDXOSVERRORF
|
||||
void OsVendorVErrorF (const char *pszFormat, va_list va_args);
|
||||
#endif
|
||||
void winInitializeDefaultScreens (void);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -106,7 +108,6 @@ static PixmapFormatRec g_PixmapFormats[] = {
|
|||
|
||||
const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]);
|
||||
|
||||
|
||||
void
|
||||
winInitializeDefaultScreens (void)
|
||||
{
|
||||
|
|
@ -221,7 +222,7 @@ ddxGiveUp()
|
|||
{
|
||||
FreeLibrary (g_hmodCommonControls);
|
||||
g_hmodCommonControls = NULL;
|
||||
g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
|
||||
g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
|
||||
}
|
||||
|
||||
/* Tell Windows that we want to end the app */
|
||||
|
|
@ -367,6 +368,9 @@ ddxUseMsg (void)
|
|||
|
||||
ErrorF ("-keyboard\n"
|
||||
"\tSpecify a keyboard device from the configuration file.\n");
|
||||
|
||||
ErrorF ("-nounicodeclipboard\n"
|
||||
"\tDo not use Unicode clipboard even if NT-based platform.\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1241,6 +1245,27 @@ ddxProcessArgument (int argc, char *argv[], int i)
|
|||
return 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for the '-nounicodeclipboard' argument
|
||||
*/
|
||||
if (IS_OPTION ("-nounicodeclipboard"))
|
||||
{
|
||||
g_fUnicodeClipboard = FALSE;
|
||||
/* Indicate that we have processed the argument */
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef XKB
|
||||
/*
|
||||
* Look for the '-kb' argument
|
||||
*/
|
||||
if (IS_OPTION ("-kb"))
|
||||
{
|
||||
g_cmdline.noXkbExtension = TRUE;
|
||||
return 0; /* Let DIX parse this again */
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1312,7 +1337,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
|
|||
g_hmodCommonControls = NULL;
|
||||
|
||||
/* Set function pointer to point to no operation function */
|
||||
g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
|
||||
g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@
|
|||
#include "windowstr.h"
|
||||
#include "mi.h"
|
||||
#include "micmap.h"
|
||||
#include "migc.h"
|
||||
#include "mifillarc.h"
|
||||
#include "mifpoly.h"
|
||||
#include "mibstore.h"
|
||||
|
|
@ -300,6 +299,8 @@ typedef Bool (*winCreatePrimarySurfaceProcPtr)(ScreenPtr);
|
|||
|
||||
typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
|
||||
|
||||
typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin);
|
||||
|
||||
|
||||
/*
|
||||
* GC (graphics context) privates
|
||||
|
|
@ -541,6 +542,9 @@ typedef struct _winPrivScreenRec
|
|||
winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
|
||||
winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
|
||||
|
||||
/* Window Procedures for MultiWindow mode */
|
||||
winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow;
|
||||
|
||||
/* Window Procedures for Rootless mode */
|
||||
CreateWindowProcPtr CreateWindow;
|
||||
DestroyWindowProcPtr DestroyWindow;
|
||||
|
|
@ -767,7 +771,7 @@ winInitClipboard (pthread_t *ptClipboardProc,
|
|||
*/
|
||||
|
||||
void
|
||||
winDeinitClipboard ();
|
||||
winDeinitClipboard (void);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -854,13 +858,13 @@ winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv);
|
|||
*/
|
||||
|
||||
void
|
||||
winDetectSupportedEngines ();
|
||||
winDetectSupportedEngines (void);
|
||||
|
||||
Bool
|
||||
winSetEngine (ScreenPtr pScreen);
|
||||
|
||||
Bool
|
||||
winGetDDProcAddresses ();
|
||||
winGetDDProcAddresses (void);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -971,16 +975,13 @@ void
|
|||
winInitializeModeKeyStates (void);
|
||||
|
||||
void
|
||||
winStoreModeKeyStates (ScreenPtr pScreen);
|
||||
|
||||
void
|
||||
winRestoreModeKeyStates (ScreenPtr pScreen);
|
||||
winRestoreModeKeyStates (void);
|
||||
|
||||
Bool
|
||||
winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
void
|
||||
winKeybdReleaseKeys ();
|
||||
winKeybdReleaseKeys (void);
|
||||
|
||||
void
|
||||
winSendKeyEvent (DWORD dwKey, Bool fDown);
|
||||
|
|
@ -1461,10 +1462,6 @@ winSetShapePRootless (WindowPtr pWindow);
|
|||
HICON
|
||||
winXIconToHICON (WindowPtr pWin);
|
||||
|
||||
void
|
||||
winUpdateIcon (Window id);
|
||||
|
||||
|
||||
/*
|
||||
* winmultiwindowshape.c
|
||||
*/
|
||||
|
|
@ -1659,7 +1656,7 @@ winWin32RootlessWindowProc (HWND hwnd, UINT message,
|
|||
*/
|
||||
|
||||
void
|
||||
winWindowsWMExtensionInit ();
|
||||
winWindowsWMExtensionInit (void);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ winInitClipboard (pthread_t *ptClipboardProc,
|
|||
DWORD dwScreen);
|
||||
|
||||
HWND
|
||||
winClipboardCreateMessagingWindow ();
|
||||
winClipboardCreateMessagingWindow (void);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -120,14 +120,14 @@ void *
|
|||
winClipboardProc (void *pArg);
|
||||
|
||||
void
|
||||
winDeinitClipboard ();
|
||||
winDeinitClipboard (void);
|
||||
|
||||
/*
|
||||
* winclipboardunicode.c
|
||||
*/
|
||||
|
||||
Bool
|
||||
winClipboardDetectUnicodeSupport ();
|
||||
winClipboardDetectUnicodeSupport (void);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ winInitClipboard (pthread_t *ptClipboardProc,
|
|||
*/
|
||||
|
||||
HWND
|
||||
winClipboardCreateMessagingWindow ()
|
||||
winClipboardCreateMessagingWindow (void)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
HWND hwnd;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void
|
||||
winClipboardDOStoUNIX (char *pszSrc, int iLength);
|
||||
void
|
||||
winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
|
||||
|
||||
/*
|
||||
* Convert \r\n to \n
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
*/
|
||||
|
||||
extern Bool g_fCalledSetLocale;
|
||||
extern Bool g_fUnicodeClipboard;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -105,10 +106,10 @@ winClipboardProc (void *pArg)
|
|||
ErrorF ("winClipboardProc - pthread_mutex_lock () returned.\n");
|
||||
|
||||
/* Do we have Unicode support? */
|
||||
fUnicodeSupport = winClipboardDetectUnicodeSupport ();
|
||||
fUnicodeSupport = g_fUnicodeClipboard && winClipboardDetectUnicodeSupport ();
|
||||
|
||||
/* Set the current locale? What does this do? */
|
||||
if (fUnicodeSupport && !g_fCalledSetLocale)
|
||||
if (!g_fCalledSetLocale)
|
||||
{
|
||||
ErrorF ("winClipboardProc - Calling setlocale ()\n");
|
||||
if (!setlocale (LC_ALL, ""))
|
||||
|
|
@ -477,7 +478,7 @@ winClipboardIOErrorHandler (Display *pDisplay)
|
|||
*/
|
||||
|
||||
void
|
||||
winDeinitClipboard ()
|
||||
winDeinitClipboard (void)
|
||||
{
|
||||
ErrorF ("winDeinitClipboard - Noting shutdown in progress\n");
|
||||
g_shutdown = TRUE;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
#include "win.h"
|
||||
|
||||
Bool
|
||||
winClipboardDetectUnicodeSupport (void);
|
||||
|
||||
/*
|
||||
* Determine whether we suport Unicode or not.
|
||||
|
|
@ -38,7 +40,7 @@
|
|||
*/
|
||||
|
||||
Bool
|
||||
winClipboardDetectUnicodeSupport ()
|
||||
winClipboardDetectUnicodeSupport (void)
|
||||
{
|
||||
Bool fReturn = FALSE;
|
||||
OSVERSIONINFO osvi;
|
||||
|
|
|
|||
|
|
@ -48,9 +48,11 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
Display *pDisplay,
|
||||
Bool fUnicodeSupport)
|
||||
{
|
||||
#if 0
|
||||
Atom atomReturnType;
|
||||
int iReturnFormat;
|
||||
unsigned long ulReturnItems;
|
||||
#endif
|
||||
XTextProperty xtpText;
|
||||
XEvent event;
|
||||
XSelectionEvent eventSelection;
|
||||
|
|
@ -61,13 +63,15 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
HGLOBAL hGlobal;
|
||||
Bool fReturn = TRUE;
|
||||
XICCEncodingStyle xiccesStyle;
|
||||
int iUTF8;
|
||||
char *pszUTF8 = NULL;
|
||||
int iConvertDataLen = 0;
|
||||
char *pszConvertData = NULL;
|
||||
char *pszTextList[2];
|
||||
int iCount;
|
||||
char **ppszTextList = NULL;
|
||||
wchar_t *pwszUnicodeStr = NULL;
|
||||
int iUnicodeLen = 0;
|
||||
int iReturnDataLen = 0;
|
||||
int i;
|
||||
|
||||
/* Process all pending events */
|
||||
while (XPending (pDisplay))
|
||||
|
|
@ -251,7 +255,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
/* Convert the Unicode string to UTF8 (MBCS) */
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
iUTF8 = WideCharToMultiByte (CP_UTF8,
|
||||
iConvertDataLen = WideCharToMultiByte (CP_UTF8,
|
||||
0,
|
||||
(LPCWSTR)pszGlobalData,
|
||||
-1,
|
||||
|
|
@ -259,57 +263,62 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
pszUTF8 = (char *) malloc (iUTF8); /* Don't need +1 */
|
||||
/* NOTE: iConvertDataLen includes space for null terminator */
|
||||
pszConvertData = (char *) malloc (iConvertDataLen);
|
||||
WideCharToMultiByte (CP_UTF8,
|
||||
0,
|
||||
(LPCWSTR)pszGlobalData,
|
||||
-1,
|
||||
pszUTF8,
|
||||
iUTF8,
|
||||
pszConvertData,
|
||||
iConvertDataLen,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pszConvertData = strdup (pszGlobalData);
|
||||
iConvertDataLen = strlen (pszConvertData) + 1;
|
||||
}
|
||||
|
||||
/* Convert DOS string to UNIX string */
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
winClipboardDOStoUNIX (pszUTF8, strlen (pszUTF8));
|
||||
winClipboardDOStoUNIX (pszConvertData, strlen (pszConvertData));
|
||||
|
||||
/* Setup our text list */
|
||||
pszTextList[0] = pszUTF8;
|
||||
pszTextList[0] = pszConvertData;
|
||||
pszTextList[1] = NULL;
|
||||
|
||||
/* Initialize the text property */
|
||||
xtpText.value = NULL;
|
||||
|
||||
/* Create the text property from the text list */
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
iReturn = Xutf8TextListToTextProperty (pDisplay,
|
||||
pszTextList,
|
||||
1,
|
||||
xiccesStyle,
|
||||
&xtpText);
|
||||
}
|
||||
else
|
||||
{
|
||||
iReturn = XmbTextListToTextProperty (pDisplay,
|
||||
pszTextList,
|
||||
1,
|
||||
xiccesStyle,
|
||||
&xtpText);
|
||||
}
|
||||
if (iReturn == XNoMemory || iReturn == XLocaleNotSupported)
|
||||
{
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
|
||||
"Xutf8TextListToTextProperty failed: %d\n",
|
||||
"X*TextListToTextProperty failed: %d\n",
|
||||
iReturn);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Free the UTF8 string */
|
||||
free (pszUTF8);
|
||||
}
|
||||
else
|
||||
winClipboardDOStoUNIX (pszGlobalData, strlen (pszGlobalData));
|
||||
|
||||
/*
|
||||
* FIXME: Pass pszGlobalData and strlen (pszGlobalData(
|
||||
* on 1 byte, pass xtpText.value and xtpText.nitems
|
||||
* on 2 byte.
|
||||
*/
|
||||
/* Free the converted string */
|
||||
free (pszConvertData);
|
||||
|
||||
/* Copy the clipboard text to the requesting window */
|
||||
if (fUnicodeSupport)
|
||||
iReturn = XChangeProperty (pDisplay,
|
||||
event.xselectionrequest.requestor,
|
||||
event.xselectionrequest.property,
|
||||
|
|
@ -318,15 +327,6 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
PropModeReplace,
|
||||
xtpText.value,
|
||||
xtpText.nitems);
|
||||
else
|
||||
iReturn = XChangeProperty (pDisplay,
|
||||
event.xselectionrequest.requestor,
|
||||
event.xselectionrequest.property,
|
||||
event.xselectionrequest.target,
|
||||
8,
|
||||
PropModeReplace,
|
||||
pszGlobalData,
|
||||
strlen (pszGlobalData));
|
||||
if (iReturn == BadAlloc || iReturn == BadAtom
|
||||
|| iReturn == BadMatch || iReturn == BadValue
|
||||
|| iReturn == BadWindow)
|
||||
|
|
@ -342,12 +342,9 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
pszGlobalData = NULL;
|
||||
CloseClipboard ();
|
||||
|
||||
/* FIXME: Don't clean up on 1 byte. */
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
/* Clean up */
|
||||
XFree (xtpText.value);
|
||||
xtpText.value = NULL;
|
||||
}
|
||||
|
||||
/* Setup selection notify event */
|
||||
eventSelection.type = SelectionNotify;
|
||||
|
|
@ -408,8 +405,6 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
* What are we doing here?
|
||||
*
|
||||
*/
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
if (event.xselection.property == None)
|
||||
{
|
||||
if(event.xselection.target == XA_STRING)
|
||||
|
|
@ -462,10 +457,8 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
return fReturn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Retrieve the size of the stored data */
|
||||
if (fUnicodeSupport)
|
||||
iReturn = XGetWindowProperty (pDisplay,
|
||||
iWindow,
|
||||
atomLocalProperty,
|
||||
|
|
@ -478,19 +471,6 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
&xtpText.nitems,
|
||||
&ulReturnBytesLeft,
|
||||
&xtpText.value);
|
||||
else
|
||||
iReturn = XGetWindowProperty (pDisplay,
|
||||
iWindow,
|
||||
atomLocalProperty,
|
||||
0,
|
||||
0, /* Don't get data, just size */
|
||||
False,
|
||||
AnyPropertyType,
|
||||
&atomReturnType,
|
||||
&iReturnFormat,
|
||||
&ulReturnItems,
|
||||
&ulReturnBytesLeft,
|
||||
&pszReturnData);
|
||||
if (iReturn != Success)
|
||||
{
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
|
||||
|
|
@ -499,16 +479,11 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
}
|
||||
|
||||
#if 0
|
||||
if (fUnicodeSupport)
|
||||
ErrorF ("SelectionNotify - returned data %d left %d\n",
|
||||
xtpText.nitems, ulReturnBytesLeft);
|
||||
else
|
||||
ErrorF ("SelectionNotify - returned data %d left %d\n",
|
||||
ulReturnItems, ulReturnBytesLeft);
|
||||
#endif
|
||||
|
||||
/* Request the selection data */
|
||||
if (fUnicodeSupport)
|
||||
iReturn = XGetWindowProperty (pDisplay,
|
||||
iWindow,
|
||||
atomLocalProperty,
|
||||
|
|
@ -521,19 +496,6 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
&xtpText.nitems,
|
||||
&ulReturnBytesLeft,
|
||||
&xtpText.value);
|
||||
else
|
||||
iReturn = XGetWindowProperty (pDisplay,
|
||||
iWindow,
|
||||
atomLocalProperty,
|
||||
0,
|
||||
ulReturnBytesLeft,
|
||||
False,
|
||||
AnyPropertyType,
|
||||
&atomReturnType,
|
||||
&iReturnFormat,
|
||||
&ulReturnItems,
|
||||
&ulReturnBytesLeft,
|
||||
&pszReturnData);
|
||||
if (iReturn != Success)
|
||||
{
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
|
||||
|
|
@ -541,40 +503,80 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
#if 0
|
||||
{
|
||||
char *pszAtomName = NULL;
|
||||
|
||||
ErrorF ("SelectionNotify - returned data %d left %d\n",
|
||||
prop.nitems, ulReturnBytesLeft);
|
||||
xtpText.nitems, ulReturnBytesLeft);
|
||||
|
||||
pszAtomName = XGetAtomName(pDisplay, prop.encoding);
|
||||
pszAtomName = XGetAtomName(pDisplay, xtpText.encoding);
|
||||
ErrorF ("Notify atom name %s\n", pszAtomName);
|
||||
XFree (pszAtomName);
|
||||
pszAtomName = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fUnicodeSupport)
|
||||
{
|
||||
/* Convert the text property to a text list */
|
||||
Xutf8TextPropertyToTextList (pDisplay,
|
||||
iReturn = Xutf8TextPropertyToTextList (pDisplay,
|
||||
&xtpText,
|
||||
&ppszTextList,
|
||||
&iCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
iReturn = XmbTextPropertyToTextList (pDisplay,
|
||||
&xtpText,
|
||||
&ppszTextList,
|
||||
&iCount);
|
||||
if (iCount > 0)
|
||||
}
|
||||
if (iReturn == Success || iReturn > 0)
|
||||
{
|
||||
/* Conversion succeeded or some unconvertible characters */
|
||||
if (ppszTextList != NULL)
|
||||
{
|
||||
pszReturnData = malloc (strlen (ppszTextList[0]) + 1);
|
||||
strcpy (pszReturnData, ppszTextList[0]);
|
||||
for (i = 0; i < iCount; i++)
|
||||
{
|
||||
iReturnDataLen += strlen(ppszTextList[i]);
|
||||
}
|
||||
pszReturnData = malloc (iReturnDataLen + 1);
|
||||
pszReturnData[0] = '\0';
|
||||
for (i = 0; i < iCount; i++)
|
||||
{
|
||||
strcat (pszReturnData, ppszTextList[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
|
||||
"X*TextPropertyToTextList list_return is NULL\n");
|
||||
pszReturnData = malloc (1);
|
||||
pszReturnData[0] = 0;
|
||||
pszReturnData[0] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (iReturn)
|
||||
{
|
||||
case XNoMemory:
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - XNoMemory\n");
|
||||
break;
|
||||
case XConverterNotFound:
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - XConverterNotFound\n");
|
||||
break;
|
||||
default:
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - Unknown Error\n");
|
||||
break;
|
||||
}
|
||||
pszReturnData = malloc (1);
|
||||
pszReturnData[0] = '\0';
|
||||
}
|
||||
|
||||
/* Free the data returned from XGetWindowProperty */
|
||||
XFreeStringList (ppszTextList);
|
||||
XFree (xtpText.value);
|
||||
}
|
||||
|
||||
/* Convert the X clipboard string to DOS format */
|
||||
winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
|
||||
|
|
@ -601,6 +603,11 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
pwszUnicodeStr,
|
||||
iUnicodeLen);
|
||||
}
|
||||
else
|
||||
{
|
||||
pszConvertData = strdup (pszReturnData);
|
||||
iConvertDataLen = strlen (pszConvertData) + 1;
|
||||
}
|
||||
|
||||
/* Access the Windows clipboard */
|
||||
if (!OpenClipboard (hwnd))
|
||||
|
|
@ -623,7 +630,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
hGlobal = GlobalAlloc (GMEM_MOVEABLE,
|
||||
sizeof (wchar_t) * (iUnicodeLen + 1));
|
||||
else
|
||||
hGlobal = GlobalAlloc (GMEM_MOVEABLE, strlen (pszReturnData) + 1);
|
||||
hGlobal = GlobalAlloc (GMEM_MOVEABLE, iConvertDataLen);
|
||||
|
||||
/* Obtain a pointer to the global memory */
|
||||
pszGlobalData = GlobalLock (hGlobal);
|
||||
|
|
@ -640,7 +647,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
pwszUnicodeStr,
|
||||
sizeof (wchar_t) * (iUnicodeLen + 1));
|
||||
else
|
||||
strcpy (pszGlobalData, pszReturnData);
|
||||
strcpy (pszGlobalData, pszConvertData);
|
||||
|
||||
/* Free the data returned from XGetWindowProperty */
|
||||
if (fUnicodeSupport)
|
||||
|
|
@ -650,8 +657,8 @@ winClipboardFlushXEvents (HWND hwnd,
|
|||
}
|
||||
else
|
||||
{
|
||||
XFree (pszReturnData);
|
||||
pszReturnData = NULL;
|
||||
free (pszConvertData);
|
||||
pszConvertData = NULL;
|
||||
}
|
||||
|
||||
/* Release the pointer to the global memory */
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ WinKBLayoutRec winKBLayouts[] = {
|
|||
{ 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
|
||||
{ 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
|
||||
{ 0x410, -1, "pc105", "it", NULL, NULL, "Italian"},
|
||||
{ 0x411, -1, "jp", "jp", NULL, NULL, "Japanese"},
|
||||
{ 0x411, 7, "jp", "jp", NULL, NULL, "Japanese"},
|
||||
{ 0x414, -1, "pc105", "no", NULL, NULL, "Norwegian"},
|
||||
{ 0x416, -1, "pc105", "pt", NULL, NULL, "Portuguese (Brazil, ABNT)"},
|
||||
{0x10416, -1, "abnt2", "br", NULL, NULL, "Portuguese (Brazil, ABNT2)"},
|
||||
|
|
@ -265,6 +265,32 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
g_winInfo.xkb.options = NULL;
|
||||
# endif /* PC98 */
|
||||
|
||||
#ifdef XKB
|
||||
/*
|
||||
* Query the windows autorepeat settings and change the xserver defaults.
|
||||
* If XKB is disabled then windows handles the autorepeat and the special
|
||||
* treatment is not needed
|
||||
*/
|
||||
{
|
||||
int kbd_delay;
|
||||
DWORD kbd_speed;
|
||||
if (SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &kbd_delay, 0) &&
|
||||
SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &kbd_speed, 0))
|
||||
{
|
||||
switch (kbd_delay)
|
||||
{
|
||||
case 0: g_winInfo.keyboard.delay = 250; break;
|
||||
case 1: g_winInfo.keyboard.delay = 500; break;
|
||||
case 2: g_winInfo.keyboard.delay = 750; break;
|
||||
default:
|
||||
case 3: g_winInfo.keyboard.delay = 1000; break;
|
||||
}
|
||||
g_winInfo.keyboard.rate = max(1,kbd_speed);
|
||||
winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%d, rate=%d\n",
|
||||
g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
keyboardType = GetKeyboardType (0);
|
||||
|
|
@ -280,7 +306,7 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
too */
|
||||
layoutNum = (layoutNum & 0xffff);
|
||||
}
|
||||
winMsg (X_DEFAULT, "winConfigKeyboard - Layout: \"%s\" (%08x) \n",
|
||||
winMsg (X_PROBED, "winConfigKeyboard - Layout: \"%s\" (%08x) \n",
|
||||
layoutName, layoutNum);
|
||||
|
||||
for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++)
|
||||
|
|
@ -290,9 +316,9 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
|
||||
continue;
|
||||
|
||||
winMsg (X_DEFAULT,
|
||||
"Using preset keyboard for \"%s\" (%s), type \"%d\"\n",
|
||||
pLayout->layoutname, layoutName, keyboardType);
|
||||
winMsg (X_PROBED,
|
||||
"Using preset keyboard for \"%s\" (%x), type \"%d\"\n",
|
||||
pLayout->layoutname, pLayout->winlayout, keyboardType);
|
||||
|
||||
g_winInfo.xkb.model = pLayout->xkbmodel;
|
||||
g_winInfo.xkb.layout = pLayout->xkblayout;
|
||||
|
|
@ -300,6 +326,18 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
g_winInfo.xkb.options = pLayout->xkboptions;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((layoutNum == 0x411) && keyboardType == 7)
|
||||
{
|
||||
/* Japanese layouts have problems with key event messages
|
||||
such as the lack of WM_KEYUP for Caps Lock key.
|
||||
Loading US layout fixes this problem. */
|
||||
if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL)
|
||||
winMsg (X_INFO, "Loading US keyboard layout.\n");
|
||||
else
|
||||
winMsg (X_ERROR, "LoadKeyboardLaout failed.\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
g_winInfo.xkb.initialMap = NULL;
|
||||
|
|
@ -339,10 +377,29 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
|
||||
if (kbd != NULL)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if (kbd->inp_identifier)
|
||||
winMsg (kbdfrom, "Using keyboard \"%s\" as primary keyboard\n",
|
||||
kbd->inp_identifier);
|
||||
|
||||
if ((s = winSetStrOption(kbd->inp_option_lst, "AutoRepeat", NULL)))
|
||||
{
|
||||
if ((sscanf(s, "%ld %ld", &g_winInfo.keyboard.delay,
|
||||
&g_winInfo.keyboard.rate) != 2) ||
|
||||
(g_winInfo.keyboard.delay < 1) ||
|
||||
(g_winInfo.keyboard.rate == 0) ||
|
||||
(1000 / g_winInfo.keyboard.rate) < 1)
|
||||
{
|
||||
winErrorFVerb (2, "\"%s\" is not a valid AutoRepeat value", s);
|
||||
xfree(s);
|
||||
return FALSE;
|
||||
}
|
||||
xfree(s);
|
||||
winMsg (X_CONFIG, "AutoRepeat: %ld %ld\n",
|
||||
g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
|
||||
}
|
||||
|
||||
#ifdef XKB
|
||||
from = X_DEFAULT;
|
||||
if (g_cmdline.noXkbExtension)
|
||||
|
|
@ -365,8 +422,6 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
}
|
||||
else
|
||||
{
|
||||
char *s;
|
||||
|
||||
if ((s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL)))
|
||||
{
|
||||
g_winInfo.xkb.rules = NULL_IF_EMPTY (s);
|
||||
|
|
@ -456,6 +511,13 @@ winConfigKeyboard (DeviceIntPtr pDevice)
|
|||
{
|
||||
winMsg (X_ERROR, "No primary keyboard configured\n");
|
||||
winMsg (X_DEFAULT, "Using compiletime defaults for keyboard\n");
|
||||
#ifdef XKB
|
||||
if (g_cmdline.noXkbExtension)
|
||||
{
|
||||
g_winInfo.xkb.disable = TRUE;
|
||||
winMsg (X_CMDLINE, "XkbExtension disabled\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@
|
|||
#include "win.h"
|
||||
|
||||
#ifdef DDXOSVERRORF
|
||||
/* Prototype */
|
||||
void
|
||||
OsVendorVErrorF (const char *pszFormat, va_list va_args);
|
||||
|
||||
void
|
||||
OsVendorVErrorF (const char *pszFormat, va_list va_args)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,9 +41,12 @@
|
|||
#define XKB_IN_SERVER
|
||||
#include "XKBsrv.h"
|
||||
#endif
|
||||
#include "../../Xext/xf86miscproc.h"
|
||||
|
||||
static Bool g_winKeyState[NUM_KEYCODES];
|
||||
|
||||
/* Stored to get internal mode key states. Must be read-only. */
|
||||
static unsigned short const *g_winInternalModeKeyStatesPtr = NULL;
|
||||
|
||||
#if WIN_NEW_KEYBOARD_SUPPORT
|
||||
|
||||
|
|
@ -353,6 +356,8 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
|||
DevicePtr pDevice = (DevicePtr) pDeviceInt;
|
||||
#ifdef XKB
|
||||
XkbComponentNamesRec names;
|
||||
XkbSrvInfoPtr xkbi;
|
||||
XkbControlsPtr ctrl;
|
||||
#endif
|
||||
|
||||
switch (iState)
|
||||
|
|
@ -415,7 +420,29 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
|
|||
modMap, winKeybdBell, winKeybdCtrl);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef XKB
|
||||
if (!g_winInfo.xkb.disable)
|
||||
{
|
||||
xkbi = pDeviceInt->key->xkbInfo;
|
||||
if (xkbi != NULL)
|
||||
{
|
||||
ctrl = xkbi->desc->ctrls;
|
||||
ctrl->repeat_delay = g_winInfo.keyboard.delay;
|
||||
ctrl->repeat_interval = 1000/g_winInfo.keyboard.rate;
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorF ("winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
|
||||
break;
|
||||
|
||||
case DEVICE_ON:
|
||||
pDevice->on = TRUE;
|
||||
break;
|
||||
|
|
@ -472,35 +499,6 @@ winInitializeModeKeyStates (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* We have to store the last state of each mode
|
||||
* key before we lose the keyboard focus.
|
||||
*/
|
||||
|
||||
void
|
||||
winStoreModeKeyStates (ScreenPtr pScreen)
|
||||
{
|
||||
#if !WIN_NEW_KEYBOARD_SUPPORT
|
||||
winScreenPriv(pScreen);
|
||||
|
||||
/* Initialize all mode key states to off */
|
||||
pScreenPriv->dwModeKeyStates = 0x0L;
|
||||
|
||||
pScreenPriv->dwModeKeyStates |=
|
||||
(GetKeyState (VK_NUMLOCK) & 0x0001) << NumLockMapIndex;
|
||||
|
||||
pScreenPriv->dwModeKeyStates |=
|
||||
(GetKeyState (VK_SCROLL) & 0x0001) << ScrollLockMapIndex;
|
||||
|
||||
pScreenPriv->dwModeKeyStates |=
|
||||
(GetKeyState (VK_CAPITAL) & 0x0001) << LockMapIndex;
|
||||
|
||||
pScreenPriv->dwModeKeyStates |=
|
||||
(GetKeyState (VK_KANA) & 0x0001) << KanaMapIndex;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Upon regaining the keyboard focus we must
|
||||
* resynchronize our internal mode key states
|
||||
|
|
@ -508,11 +506,21 @@ winStoreModeKeyStates (ScreenPtr pScreen)
|
|||
*/
|
||||
|
||||
void
|
||||
winRestoreModeKeyStates (ScreenPtr pScreen)
|
||||
winRestoreModeKeyStates ()
|
||||
{
|
||||
#if !WIN_NEW_KEYBOARD_SUPPORT
|
||||
winScreenPriv(pScreen);
|
||||
DWORD dwKeyState;
|
||||
unsigned short internalKeyStates;
|
||||
|
||||
/* X server is being initialized */
|
||||
if (!g_winInternalModeKeyStatesPtr)
|
||||
return;
|
||||
|
||||
/* Force to process all pending events in the mi event queue */
|
||||
mieqProcessInputEvents ();
|
||||
|
||||
/* Read the mode key states of our X server */
|
||||
internalKeyStates = *g_winInternalModeKeyStatesPtr;
|
||||
|
||||
/*
|
||||
* NOTE: The C XOR operator, ^, will not work here because it is
|
||||
|
|
@ -522,7 +530,7 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
|
|||
|
||||
/* Has the key state changed? */
|
||||
dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001;
|
||||
if (WIN_XOR (pScreenPriv->dwModeKeyStates & NumLockMask, dwKeyState))
|
||||
if (WIN_XOR (internalKeyStates & NumLockMask, dwKeyState))
|
||||
{
|
||||
winSendKeyEvent (KEY_NumLock, TRUE);
|
||||
winSendKeyEvent (KEY_NumLock, FALSE);
|
||||
|
|
@ -530,7 +538,7 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
|
|||
|
||||
/* Has the key state changed? */
|
||||
dwKeyState = GetKeyState (VK_CAPITAL) & 0x0001;
|
||||
if (WIN_XOR (pScreenPriv->dwModeKeyStates & LockMask, dwKeyState))
|
||||
if (WIN_XOR (internalKeyStates & LockMask, dwKeyState))
|
||||
{
|
||||
winSendKeyEvent (KEY_CapsLock, TRUE);
|
||||
winSendKeyEvent (KEY_CapsLock, FALSE);
|
||||
|
|
@ -538,7 +546,7 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
|
|||
|
||||
/* Has the key state changed? */
|
||||
dwKeyState = GetKeyState (VK_SCROLL) & 0x0001;
|
||||
if (WIN_XOR (pScreenPriv->dwModeKeyStates & ScrollLockMask, dwKeyState))
|
||||
if (WIN_XOR (internalKeyStates & ScrollLockMask, dwKeyState))
|
||||
{
|
||||
winSendKeyEvent (KEY_ScrollLock, TRUE);
|
||||
winSendKeyEvent (KEY_ScrollLock, FALSE);
|
||||
|
|
@ -546,7 +554,7 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
|
|||
|
||||
/* Has the key state changed? */
|
||||
dwKeyState = GetKeyState (VK_KANA) & 0x0001;
|
||||
if (WIN_XOR (pScreenPriv->dwModeKeyStates & KanaMask, dwKeyState))
|
||||
if (WIN_XOR (internalKeyStates & KanaMask, dwKeyState))
|
||||
{
|
||||
winSendKeyEvent (KEY_HKTG, TRUE);
|
||||
winSendKeyEvent (KEY_HKTG, FALSE);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,13 @@
|
|||
|
||||
#include "win.h"
|
||||
|
||||
#if defined(XFree86Server) && defined(XINPUT)
|
||||
#include "inputstr.h"
|
||||
|
||||
/* Peek the internal button mapping */
|
||||
static CARD8 const *g_winMouseButtonMap = NULL;
|
||||
#endif
|
||||
|
||||
void
|
||||
winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl)
|
||||
{
|
||||
|
|
@ -65,6 +72,10 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
|
|||
miPointerGetMotionEvents,
|
||||
winMouseCtrl,
|
||||
miPointerGetMotionBufferSize ());
|
||||
|
||||
#if defined(XFree86Server) && defined(XINPUT)
|
||||
g_winMouseButtonMap = pDeviceInt->button->map;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case DEVICE_ON:
|
||||
|
|
@ -85,7 +96,7 @@ int
|
|||
winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
|
||||
{
|
||||
winScreenPriv(pScreen);
|
||||
xEvent xCurrentEvent;
|
||||
int button; /* Button4 or Button5 */
|
||||
|
||||
/* Button4 = WheelUp */
|
||||
/* Button5 = WheelDown */
|
||||
|
|
@ -136,11 +147,11 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
|
|||
/* Set the button to indicate up or down wheel delta */
|
||||
if (iDeltaZ > 0)
|
||||
{
|
||||
xCurrentEvent.u.u.detail = Button4;
|
||||
button = Button4;
|
||||
}
|
||||
else
|
||||
{
|
||||
xCurrentEvent.u.u.detail = Button5;
|
||||
button = Button5;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -157,16 +168,10 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
|
|||
while (iDeltaZ--)
|
||||
{
|
||||
/* Push the wheel button */
|
||||
xCurrentEvent.u.u.type = ButtonPress;
|
||||
xCurrentEvent.u.keyButtonPointer.time
|
||||
= g_c32LastInputEventTime = GetTickCount ();
|
||||
mieqEnqueue (&xCurrentEvent);
|
||||
winMouseButtonsSendEvent (ButtonPress, button);
|
||||
|
||||
/* Release the wheel button */
|
||||
xCurrentEvent.u.u.type = ButtonRelease;
|
||||
xCurrentEvent.u.keyButtonPointer.time
|
||||
= g_c32LastInputEventTime = GetTickCount ();
|
||||
mieqEnqueue (&xCurrentEvent);
|
||||
winMouseButtonsSendEvent (ButtonRelease, button);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -184,6 +189,11 @@ winMouseButtonsSendEvent (int iEventType, int iButton)
|
|||
|
||||
/* Load an xEvent and enqueue the event */
|
||||
xCurrentEvent.u.u.type = iEventType;
|
||||
#if defined(XFree86Server) && defined(XINPUT)
|
||||
if (g_winMouseButtonMap)
|
||||
xCurrentEvent.u.u.detail = g_winMouseButtonMap[iButton];
|
||||
else
|
||||
#endif
|
||||
xCurrentEvent.u.u.detail = iButton;
|
||||
xCurrentEvent.u.keyButtonPointer.time
|
||||
= g_c32LastInputEventTime = GetTickCount ();
|
||||
|
|
|
|||
|
|
@ -458,6 +458,7 @@ winCreateWindowsWindow (WindowPtr pWin)
|
|||
char pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
|
||||
char *res_name, *res_class, *res_role;
|
||||
static int s_iWindowID = 0;
|
||||
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
||||
|
||||
#if CYGMULTIWINDOW_DEBUG
|
||||
ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
|
||||
|
|
@ -560,6 +561,9 @@ winCreateWindowsWindow (WindowPtr pWin)
|
|||
|
||||
/* Flag that this Windows window handles its own activation */
|
||||
SetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
|
||||
|
||||
/* Call engine-specific create window procedure */
|
||||
(*pScreenPriv->pwinFinishCreateWindowsWindow) (pWin);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,13 @@
|
|||
#include <windows.h>
|
||||
|
||||
/* Local headers */
|
||||
#include "obj_base.h"
|
||||
#include "ddraw.h"
|
||||
#include "winwindow.h"
|
||||
|
||||
#ifndef CYGDEBUG
|
||||
#define CYGDEBUG NO
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constant defines
|
||||
|
|
@ -399,10 +404,10 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
|
|||
/* */
|
||||
if (nNum && ppList && *ppList)
|
||||
{
|
||||
XFree (xtpName.value);
|
||||
*ppName = strdup (*ppList);
|
||||
XFreeStringList (ppList);
|
||||
}
|
||||
XFree (xtpName.value);
|
||||
|
||||
#if CYGMULTIWINDOW_DEBUG
|
||||
ErrorF ("GetWindowName - %s %s\n",
|
||||
|
|
@ -974,16 +979,12 @@ winInitWM (void **ppWMInfo,
|
|||
* winInitMultiWindowWM -
|
||||
*/
|
||||
|
||||
Bool
|
||||
winClipboardDetectUnicodeSupport ();
|
||||
|
||||
static void
|
||||
winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
||||
{
|
||||
int iRetries = 0;
|
||||
char pszDisplay[512];
|
||||
int iReturn;
|
||||
Bool fUnicodeSupport;
|
||||
|
||||
ErrorF ("winInitMultiWindowWM - Hello\n");
|
||||
|
||||
|
|
@ -1007,11 +1008,8 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
|||
|
||||
ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () returned.\n");
|
||||
|
||||
/* Do we have Unicode support? */
|
||||
fUnicodeSupport = winClipboardDetectUnicodeSupport ();
|
||||
|
||||
/* Set the current locale? What does this do? */
|
||||
if (fUnicodeSupport && !g_fCalledSetLocale)
|
||||
if (!g_fCalledSetLocale)
|
||||
{
|
||||
ErrorF ("winInitMultiWindowWM - Calling setlocale ()\n");
|
||||
if (!setlocale (LC_ALL, ""))
|
||||
|
|
|
|||
|
|
@ -599,6 +599,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
|||
SendMessage (hwndScreen, message, wParam, lParam);
|
||||
return 0;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
|
||||
winRestoreModeKeyStates ();
|
||||
return 0;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
/* Pop any pressed keys since we are losing keyboard focus */
|
||||
winKeybdReleaseKeys ();
|
||||
|
|
@ -878,8 +885,10 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
|||
pwindPos->hwndInsertAfter);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* Pass the message to the root window */
|
||||
SendMessage (hwndScreen, message, wParam, lParam);
|
||||
#endif
|
||||
|
||||
if (s_pScreenPriv != NULL)
|
||||
s_pScreenPriv->fWindowOrderChanged = TRUE;
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ winSetEngineFunctionsNativeGDI (ScreenPtr pScreen)
|
|||
pScreenPriv->pwinStoreColors = winStoreColorsNativeGDI;
|
||||
pScreenPriv->pwinCreateColormap = winCreateColormapNativeGDI;
|
||||
pScreenPriv->pwinDestroyColormap = winDestroyColormapNativeGDI;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen)
|
|||
/* Set our pointers */
|
||||
pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD;
|
||||
pScreenPriv->pwinShadowUpdate
|
||||
= (winShadowUpdateProcPtr) (void (*)())NoopDDA;
|
||||
= (winShadowUpdateProcPtr) (void (*)(void))NoopDDA;
|
||||
pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD;
|
||||
pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD;
|
||||
pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD;
|
||||
|
|
@ -646,9 +646,11 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen)
|
|||
pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
|
||||
pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
|
||||
pScreenPriv->pwinBltExposedRegions
|
||||
= (winBltExposedRegionsProcPtr) (void (*)())NoopDDA;
|
||||
= (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA;
|
||||
pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD;
|
||||
pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD;
|
||||
pScreenPriv->pwinFinishCreateWindowsWindow =
|
||||
(winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam)
|
|||
* Set custom icons and menus again.
|
||||
*/
|
||||
static void
|
||||
ReloadPrefs ()
|
||||
ReloadPrefs (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ typedef struct WINMULTIWINDOWPREFS
|
|||
|
||||
/* Functions */
|
||||
void
|
||||
LoadPreferences();
|
||||
LoadPreferences(void);
|
||||
|
||||
void
|
||||
SetupRootMenu (unsigned long hmenuRoot);
|
||||
|
|
@ -143,5 +143,5 @@ unsigned long
|
|||
winOverrideIcon (unsigned long longpWin);
|
||||
|
||||
unsigned long
|
||||
winOverrideDefaultIcon();
|
||||
winOverrideDefaultIcon(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,15 +54,15 @@ static void SetDefaultSysMenu (char *menu, int pos);
|
|||
|
||||
static void OpenMenu(char *menuname);
|
||||
static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param);
|
||||
static void CloseMenu();
|
||||
static void CloseMenu(void);
|
||||
|
||||
static void OpenIcons();
|
||||
static void OpenIcons(void);
|
||||
static void AddIconLine(char *matchstr, char *iconfile);
|
||||
static void CloseIcons();
|
||||
static void CloseIcons(void);
|
||||
|
||||
static void OpenSysMenu();
|
||||
static void OpenSysMenu(void);
|
||||
static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
|
||||
static void CloseSysMenu();
|
||||
static void CloseSysMenu(void);
|
||||
|
||||
static int yyerror (char *s);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
|
||||
#include "win.h"
|
||||
|
||||
/* Prototypes */
|
||||
DWORD
|
||||
winGetRegistryDWORD (HKEY hkey, char *pszRegistryKey);
|
||||
|
||||
DWORD
|
||||
winGetRegistryDWORD (HKEY hkey, char *pszRegistryKey)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@
|
|||
*/
|
||||
#include "win.h"
|
||||
|
||||
void
|
||||
ROP16 (HDC hdc, int rop);
|
||||
|
||||
int g_copyROP[16] = { 0xFF0062, /* GXclear - 0 */
|
||||
0x8800C6, /* GXand - S & D */
|
||||
0x440328, /* GXandReverse - S & !D */
|
||||
|
|
|
|||
|
|
@ -34,32 +34,6 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.28 2003/08/07 23:47:58 alanh Exp $ */
|
||||
|
||||
#include "win.h"
|
||||
#include "safeAlpha.h"
|
||||
|
||||
|
||||
static RootlessFrameProcsRec winWin32RootlessProcs = {
|
||||
winWin32RootlessCreateFrame,
|
||||
winWin32RootlessDestroyFrame,
|
||||
|
||||
winWin32RootlessMoveFrame,
|
||||
winWin32RootlessResizeFrame,
|
||||
winWin32RootlessRestackFrame,
|
||||
winWin32RootlessReshapeFrame,
|
||||
winWin32RootlessUnmapFrame,
|
||||
|
||||
winWin32RootlessStartDrawing,
|
||||
winWin32RootlessStopDrawing,
|
||||
winWin32RootlessUpdateRegion,
|
||||
#ifndef ROOTLESS_TRACK_DAMAGE
|
||||
winWin32RootlessDamageRects,
|
||||
#endif
|
||||
winWin32RootlessRootlessSwitchWindow,
|
||||
|
||||
NULL,//winWin32RootlessCopyBytes,
|
||||
NULL,//winWin32RootlessFillBytes,
|
||||
NULL,//winWin32RootlessCompositePixels,
|
||||
winWin32RootlessCopyWindow
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -82,6 +56,20 @@ winScreenInit (int index,
|
|||
pScreenInfo->dwWidth, pScreenInfo->dwHeight);
|
||||
#endif
|
||||
|
||||
/* Bail if -rootless and -multiwindow flags both present */
|
||||
if (pScreenInfo->fRootless && pScreenInfo->fMultiWindow)
|
||||
{
|
||||
ErrorF ("winScreenInit - The -rootless and -multiwindow parameters\n"
|
||||
"\tcannot be used together. Note that the -rootless parameter\n"
|
||||
"\trequires an external window manager (e.g. twm), while the\n"
|
||||
"\t-multiwindow parameter forbids an external window manager\n"
|
||||
"\tsince it uses an internal window manager. Please correct\n"
|
||||
"\tyour command-line parameters; do not forget to stop\n"
|
||||
"\tlaunching an external window manager if you are using\n"
|
||||
"\tthe -multiwindow command-line parameter.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Allocate privates for this screen */
|
||||
if (!winAllocatePrivates (pScreen))
|
||||
{
|
||||
|
|
@ -415,10 +403,9 @@ winFinishScreenInitFB (int index,
|
|||
|
||||
#if !WIN_LAYER_SUPPORT
|
||||
/* Initialize the shadow framebuffer layer */
|
||||
if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
|
||||
if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
|
||||
|| pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
|
||||
|| pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
|
||||
&&(!pScreenInfo->fRootless))
|
||||
{
|
||||
#if CYGDEBUG
|
||||
ErrorF ("winFinishScreenInitFB - Calling shadowInit ()\n");
|
||||
|
|
@ -437,22 +424,39 @@ winFinishScreenInitFB (int index,
|
|||
/* Handle pseudo-rootless mode */
|
||||
if (pScreenInfo->fRootless)
|
||||
{
|
||||
ErrorF ("winScreenInit - RootlessInit\n");
|
||||
/* Define the WRAP macro temporarily for local use */
|
||||
#define WRAP(a) \
|
||||
if (pScreen->a) { \
|
||||
pScreenPriv->a = pScreen->a; \
|
||||
} else { \
|
||||
ErrorF("null screen fn " #a "\n"); \
|
||||
pScreenPriv->a = NULL; \
|
||||
}
|
||||
|
||||
RootlessInit(pScreen, &winWin32RootlessProcs);
|
||||
/* Save a pointer to each lower-level window procedure */
|
||||
WRAP(CreateWindow);
|
||||
WRAP(DestroyWindow);
|
||||
WRAP(RealizeWindow);
|
||||
WRAP(UnrealizeWindow);
|
||||
WRAP(PositionWindow);
|
||||
WRAP(ChangeWindowAttributes);
|
||||
#ifdef SHAPE
|
||||
WRAP(SetShape);
|
||||
#endif
|
||||
|
||||
ErrorF ("winScreenInit - RootlessInit - done\n");
|
||||
|
||||
rootless_CopyBytes_threshold = 0;
|
||||
rootless_FillBytes_threshold = 0;
|
||||
rootless_CompositePixels_threshold = 0;
|
||||
rootless_CopyWindow_threshold = 1;/* FIXME: How many? Profiling needed? */
|
||||
/* Assign pseudo-rootless window procedures to be top level procedures */
|
||||
pScreen->CreateWindow = winCreateWindowPRootless;
|
||||
pScreen->DestroyWindow = winDestroyWindowPRootless;
|
||||
pScreen->PositionWindow = winPositionWindowPRootless;
|
||||
pScreen->ChangeWindowAttributes = winChangeWindowAttributesPRootless;
|
||||
pScreen->RealizeWindow = winMapWindowPRootless;
|
||||
pScreen->UnrealizeWindow = winUnmapWindowPRootless;
|
||||
#ifdef SHAPE
|
||||
pScreen->SetShape = winSetShapePRootless;
|
||||
#endif
|
||||
|
||||
if (!winWin32RootlessInitCursor (pScreen))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
winWindowsWMExtensionInit ();
|
||||
/* Undefine the WRAP macro, as it is not needed elsewhere */
|
||||
#undef WRAP
|
||||
}
|
||||
/* Handle multi window mode */
|
||||
else if (pScreenInfo->fMultiWindow)
|
||||
|
|
@ -688,11 +692,11 @@ winFinishScreenInitNativeGDI (int index,
|
|||
|
||||
/* Colormap Routines */
|
||||
pScreen->CreateColormap = miInitializeColormap;
|
||||
pScreen->DestroyColormap = (DestroyColormapProcPtr) (void (*)()) NoopDDA;
|
||||
pScreen->DestroyColormap = (DestroyColormapProcPtr) (void (*)(void)) NoopDDA;
|
||||
pScreen->InstallColormap = miInstallColormap;
|
||||
pScreen->UninstallColormap = miUninstallColormap;
|
||||
pScreen->ListInstalledColormaps = miListInstalledColormaps;
|
||||
pScreen->StoreColors = (StoreColorsProcPtr) (void (*)()) NoopDDA;
|
||||
pScreen->StoreColors = (StoreColorsProcPtr) (void (*)(void)) NoopDDA;
|
||||
pScreen->ResolveColor = miResolveColor;
|
||||
|
||||
/* Bitmap */
|
||||
|
|
|
|||
|
|
@ -1365,10 +1365,11 @@ winSetEngineFunctionsShadowDD (ScreenPtr pScreen)
|
|||
pScreenPriv->pwinStoreColors = winStoreColorsShadowDD;
|
||||
pScreenPriv->pwinCreateColormap = winCreateColormapShadowDD;
|
||||
pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDD;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
|
||||
pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDD;
|
||||
pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDD;
|
||||
pScreenPriv->pwinFinishCreateWindowsWindow =
|
||||
(winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -452,6 +452,53 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create a DirectDraw surface for the new multi-window window
|
||||
*/
|
||||
|
||||
static
|
||||
Bool
|
||||
winFinishCreateWindowsWindowDDNL (WindowPtr pWin)
|
||||
{
|
||||
winWindowPriv(pWin);
|
||||
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
||||
HRESULT ddrval = DD_OK;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
int iWidth, iHeight;
|
||||
int iX, iY;
|
||||
|
||||
ErrorF ("\nwinFinishCreateWindowsWindowDDNL!\n\n");
|
||||
|
||||
iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
|
||||
iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
|
||||
|
||||
iWidth = pWin->drawable.width;
|
||||
iHeight = pWin->drawable.height;
|
||||
|
||||
/* Describe the primary surface */
|
||||
ZeroMemory (&ddsd, sizeof (ddsd));
|
||||
ddsd.dwSize = sizeof (ddsd);
|
||||
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
||||
ddsd.dwHeight = iHeight;
|
||||
ddsd.dwWidth = iWidth;
|
||||
|
||||
/* Create the primary surface */
|
||||
ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
|
||||
&ddsd,
|
||||
&pWinPriv->pddsPrimary4,
|
||||
NULL);
|
||||
if (FAILED (ddrval))
|
||||
{
|
||||
ErrorF ("winFinishCreateWindowsWindowDDNL - Could not create primary "
|
||||
"surface: %08x\n",
|
||||
(unsigned int)ddrval);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Transfer the damaged regions of the shadow framebuffer to the display.
|
||||
*/
|
||||
|
|
@ -1307,11 +1354,11 @@ winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen)
|
|||
pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL;
|
||||
pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL;
|
||||
pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
|
||||
pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL;
|
||||
pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
|
||||
pScreenPriv->pwinFinishCreateWindowsWindow
|
||||
= winFinishCreateWindowsWindowDDNL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@
|
|||
|
||||
BOOL CALLBACK
|
||||
winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam);
|
||||
Bool
|
||||
winBltExposedRegionsShadowGDI (ScreenPtr pScreen);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -1170,11 +1172,11 @@ winSetEngineFunctionsShadowGDI (ScreenPtr pScreen)
|
|||
pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI;
|
||||
pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI;
|
||||
pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
|
||||
pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)(void))NoopDDA;
|
||||
pScreenPriv->pwinCreatePrimarySurface
|
||||
= (winCreatePrimarySurfaceProcPtr) (void (*)())NoopDDA;
|
||||
= (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
|
||||
pScreenPriv->pwinReleasePrimarySurface
|
||||
= (winReleasePrimarySurfaceProcPtr) (void (*)())NoopDDA;
|
||||
= (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
#include "Xv.h"
|
||||
#include "Xvproto.h"
|
||||
|
||||
void
|
||||
winInitVideo (ScreenPtr pScreen);
|
||||
|
||||
/*
|
||||
* winInitVideo - Initialize support for the X Video (Xv) Extension.
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ winWakeupHandler (int nScreen,
|
|||
unsigned long ulResult,
|
||||
pointer pReadmask)
|
||||
{
|
||||
#if 0
|
||||
winScreenPriv((ScreenPtr)pWakeupData);
|
||||
#endif
|
||||
MSG msg;
|
||||
|
||||
/* Process all messages on our queue */
|
||||
|
|
@ -55,12 +57,5 @@ winWakeupHandler (int nScreen,
|
|||
DispatchMessage (&msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (pScreenPriv->pScreenInfo->fMultiWindow)
|
||||
winReorderWindowsMultiWindow ((ScreenPtr)pWakeupData);
|
||||
|
||||
if (pScreenPriv->pScreenInfo->fRootless)
|
||||
winWin32RootlessReorderWindows ((ScreenPtr)pWakeupData);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,15 @@ typedef struct
|
|||
Bool fXKilled;
|
||||
Bool fNeedRestore;
|
||||
POINT ptRestore;
|
||||
|
||||
/* Privates used by primary fb DirectDraw server */
|
||||
LPDDSURFACEDESC pddsdPrimary;
|
||||
|
||||
/* Privates used by shadow fb DirectDraw Nonlocking server */
|
||||
LPDIRECTDRAWSURFACE4 pddsPrimary4;
|
||||
|
||||
/* Privates used by both shadow fb DirectDraw servers */
|
||||
LPDIRECTDRAWCLIPPER pddcPrimary;
|
||||
} winPrivWinRec, *winPrivWinPtr;
|
||||
|
||||
typedef struct _winWMMessageRec{
|
||||
|
|
@ -119,12 +128,11 @@ winInitWM (void **ppWMInfo,
|
|||
int dwScreen);
|
||||
|
||||
void
|
||||
winDeinitMultiWindowWM ();
|
||||
winDeinitMultiWindowWM (void);
|
||||
|
||||
void
|
||||
winMinimizeWindow (Window id);
|
||||
|
||||
|
||||
/*
|
||||
* winmultiwindowicons.c
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "win.h"
|
||||
#include <commctrl.h>
|
||||
#include "winprefs.h"
|
||||
#include "winconfig.h"
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
|
|
@ -118,9 +119,6 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
s_hwndLastPrivates = hwnd;
|
||||
SetProp (hwnd, WIN_SCR_PROP, s_pScreenPriv);
|
||||
|
||||
/* Store the mode key states so restore doesn't try to restore them */
|
||||
winStoreModeKeyStates (s_pScreen);
|
||||
|
||||
/* Setup tray icon */
|
||||
if (!s_pScreenInfo->fNoTrayIcon)
|
||||
{
|
||||
|
|
@ -837,16 +835,13 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
break;
|
||||
|
||||
/* Restore the state of all mode keys */
|
||||
winRestoreModeKeyStates (s_pScreen);
|
||||
winRestoreModeKeyStates ();
|
||||
return 0;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||
break;
|
||||
|
||||
/* Store the state of all mode keys */
|
||||
winStoreModeKeyStates (s_pScreen);
|
||||
|
||||
/* Release any pressed keys */
|
||||
winKeybdReleaseKeys ();
|
||||
return 0;
|
||||
|
|
@ -911,12 +906,30 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
if (wParam == VK_LWIN || wParam == VK_RWIN)
|
||||
break;
|
||||
|
||||
#ifdef XKB
|
||||
/*
|
||||
* Discard presses generated from Windows auto-repeat
|
||||
* ago: Only discard them if XKB is not disabled
|
||||
*/
|
||||
if (!g_winInfo.xkb.disable)
|
||||
{
|
||||
if (lParam & (1<<30))
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */
|
||||
if (winIsFakeCtrl_L (message, wParam, lParam))
|
||||
return 0;
|
||||
|
||||
/* Send the key event(s) */
|
||||
/* Translate Windows key code to X scan code */
|
||||
winTranslateKey (wParam, lParam, &iScanCode);
|
||||
|
||||
/* Ignore repeats for CapsLock */
|
||||
if (wParam == VK_CAPITAL)
|
||||
lParam = 1;
|
||||
|
||||
/* Send the key event(s) */
|
||||
for (i = 0; i < LOWORD(lParam); ++i)
|
||||
winSendKeyEvent (iScanCode, TRUE);
|
||||
return 0;
|
||||
|
|
@ -1055,6 +1068,7 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_ENDSESSION:
|
||||
case WM_GIVEUP:
|
||||
/* Tell X that we are giving up */
|
||||
winDeinitClipboard ();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue