xserver: Branch 'master' - 9 commits
Jon TURNEY
jturney at kemper.freedesktop.org
Mon Jan 19 06:51:21 PST 2009
glx/glxdriswrast.c | 7 +++
hw/xwin/XWin.rc | 8 ++--
hw/xwin/XWinrc.man | 77 ++++++++++++++++++++++++++++++++++++---
hw/xwin/wincreatewnd.c | 8 +++-
hw/xwin/winkeybd.c | 8 ++--
hw/xwin/winmultiwindowwindow.c | 15 +++++++
hw/xwin/winmultiwindowwndproc.c | 22 +++++++++--
hw/xwin/winprefs.c | 48 ++++++++++++++++++++++++
hw/xwin/winprefs.h | 24 ++++++++++++
hw/xwin/winprefslex.l | 10 +++++
hw/xwin/winprefsyacc.y | 78 +++++++++++++++++++++++++++++++++++++++-
hw/xwin/wintrayicon.c | 2 -
hw/xwin/winwindow.h | 4 +-
os/utils.c | 7 +++
14 files changed, 294 insertions(+), 24 deletions(-)
New commits:
commit 57a5eb2583bdf1069861fe2184de9739c0d0c7c1
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Jan 4 17:40:54 2009 +0000
Xming: Update .rc file to tidy About and Exit dialogs
Tidy up About and Exit dialogs, add keyboard accelerators
Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
index 749c0f5..5a254e1 100644
--- a/hw/xwin/XWin.rc
+++ b/hw/xwin/XWin.rc
@@ -50,9 +50,9 @@ BEGIN
CONTROL "FAQ", ID_ABOUT_FAQ, "Button",
BS_OWNERDRAW | WS_TABSTOP, 135, 65, 75, 15
- DEFPUSHBUTTON "Dismiss", IDOK, 95, 85, 50, 15
+ DEFPUSHBUTTON "&OK", IDOK, 95, 85, 50, 15
- CTEXT "Welcome to the preliminary About box for the " PROJECT_NAME " X Server. This dialog was created on 2004/03/25 and will eventually be filled with more useful information. For now, use the links below to learn more about the " PROJECT_NAME " project.", IDC_STATIC, 5, 5, 230, 35
+ CTEXT PROJECT_NAME " X Server. Use the links below to learn more about the " PROJECT_NAME " project.", IDC_STATIC, 5, 5, 230, 35
END
@@ -75,11 +75,11 @@ END
EXIT_DIALOG DIALOG DISCARDABLE 32, 32, 180, 78
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
FONT 8, "MS Sans Serif"
-CAPTION PROJECT_NAME " - Exit?"
+CAPTION "Exit " PROJECT_NAME "?"
BEGIN
PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14
DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14
- CTEXT "Exiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8
+ CTEXT "E&xiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8
CTEXT "No information about connected clients available.", IDC_CLIENTS_CONNECTED, 7, 24, 166, 8
CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 36, 166, 8
END
commit df3f701ef2d41ff4be4839f473ae71d33777bea3
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Nov 2 20:17:23 2008 +0000
Xming: Ensure we dont try to print a null value when displaying xkb configuration
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 90cd5af..24a7b43 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -267,9 +267,11 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\""
" Variant = \"%s\" Options = \"%s\"\n",
- g_winInfo.xkb.rules, g_winInfo.xkb.model,
- g_winInfo.xkb.layout, g_winInfo.xkb.variant,
- g_winInfo.xkb.options);
+ g_winInfo.xkb.rules ? g_winInfo.xkb.rules : "none",
+ g_winInfo.xkb.model ? g_winInfo.xkb.model : "none",
+ g_winInfo.xkb.layout ? g_winInfo.xkb.layout : "none",
+ g_winInfo.xkb.variant ? g_winInfo.xkb.variant : "none",
+ g_winInfo.xkb.options ? g_winInfo.xkb.options : "none");
XkbSetRulesDflts (g_winInfo.xkb.rules, g_winInfo.xkb.model,
g_winInfo.xkb.layout, g_winInfo.xkb.variant,
commit c612f0df45d388c98108e1e0c80afdfae05e338e
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Nov 2 20:46:41 2008 +0000
Xming: Add styles keyword and attributes.
Add handling for style keyword and atttributes in .XWinrc
Update man page to document these additions
Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/XWinrc.man b/hw/xwin/XWinrc.man
index eba3fb6..8e2498c 100755
--- a/hw/xwin/XWinrc.man
+++ b/hw/xwin/XWinrc.man
@@ -30,6 +30,10 @@ that \fIXWin -multiwindow\fP produces for each top-level X-window.
Again, that can be done both for the generic case and for particular
programs. The new icons associated should be \fIWindows\fP format
icons \fI.ico\fP.
+.PP
+4- To change the style that is associated to the \fIWindows\fP window
+that \fI-multiwindow\fP produces for each top-level X window. Again,
+that can be done both for the generic case and for particular programs.
.SH FILE FORMAT
@@ -41,9 +45,10 @@ completely capitalized.
are legal pretty much anywhere you can have an end-of-line; they
begin with "#" or "//" and go to the end-of-line.
.PP
-Quote marks in strings are optional unless the string has included spaces.
+Quote marks in strings are optional unless the string has included spaces,
+or could be parsed, ambiguously, as a misplaced keyword.
.PP
-There are three kinds of instructions: miscellaneous, menu, and icon.
+There are four kinds of instructions: miscellaneous, menu, icon and style.
.SH Miscellaneous instruction
@@ -117,7 +122,9 @@ included at the start or at the end of the menu.
.br
\fB}\fP
.br
-Associates a specific menu to a specific WM_CLASS or WM_NAME.
+Associates a specific menu to a specified window class or name
+in \fI-multiwindow\fP mode. The keywords ATSTART or ATEND indicate if
+such items should be included at the start or at the end of the menu.
.SH Icon Instructions
@@ -131,7 +138,7 @@ When specifying an \fIicon-file\fP in the following commands several different f
.br
\t \t ("c:\\windows\\system32\\shell32.dll,4" is the default folder icon)
.br
-\fB",nn"\fP\fI index into XWin.EXE internal ICON resources\fP
+\fB",nnn"\fP\fI index into XWin.EXE internal ICON resources\fP
.br
\t \t (",101" is the 1st icon inside \fIXWin.EXE\fP)
.TP 8
@@ -155,6 +162,57 @@ Defines icon replacements windows matching the specified window class or names.
If multiple name or class matches occur for a window, only the first one
will be used.
+.SH Style Instructions
+.TP 8
+.B STYLES {
+\fIclass-or-name-of-window\fP \fIstyle-keyword-1\fP \fIstyle-keyword-2\fP
+.br
+ \fI...\fP
+.br
+\fB}\fP
+
+Associates specific styles to a specified window class or name
+in \fI-multiwindow\fP mode. If multiple class or name matches occur,
+for a window, only the first one will be used.
+
+The style keywords indicate the following:
+
+\fIstyle-keyword-1\fP
+
+\fBTOPMOST\fP
+.br
+Open the class or name above all NOTOPMOST Microsoft Windows
+.br
+\fBMAXIMIZE\fP
+.br
+Start the class or name fullscreen.
+.br
+\fBMINIMIZE\fP
+.br
+Start the class or name iconic.
+.br
+\fBBOTTOM\fP
+.br
+Open the class or name below all Windows windows.
+.br
+
+\fIstyle-keyword-2\fP
+
+\fBNOTITLE\fP
+.br
+No Windows title bar, for the class or name.
+.br
+\fBOUTLINE\fP
+.br
+No Windows title bar and just a thin-line border, for the class or name.
+.br
+\fBNOFRAME\fP
+.br
+No Windows title bar or border, for the class or name.
+
+One keyword in \fIstyle-keyword-1\fP can be used with one keyword in \fIstyle-keyword-2\fP,
+or any keyword can be used singly.
+
.SH EXAMPLE
.TP 8
@@ -170,6 +228,15 @@ This example adds an Xterm menu item to the system tray icon
ROOTMENU systray
\fP
+.TP 8
+This example makes an oclock window frameless in \fI-multiwindow\fP mode
+\fBSTYLES {
+.br
+\t oclock NOFRAME
+.br
+}
+
+
.SH "SEE ALSO"
XWin(1)
@@ -177,4 +244,4 @@ ROOTMENU systray
.SH AUTHOR
The XWinrc feature of XWin was written primarily by Earle F. Philhower
-III.
+III. Extended for style configuration by Colin Harrison.
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 30e587d..73d543a 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -26,6 +27,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -820,3 +822,49 @@ LoadPreferences ()
} /* for all menus */
}
+
+
+/*
+ * Check for a match of the window class to one specified in the
+ * STYLES{} section in the prefs file, and return the style type
+ */
+unsigned long
+winOverrideStyle (unsigned long longpWin)
+{
+ WindowPtr pWin = (WindowPtr) longpWin;
+ char *res_name, *res_class;
+ int i;
+ char *wmName;
+
+ if (pWin==NULL)
+ return STYLE_NONE;
+
+ /* If we can't find the class, we can't override from default! */
+ if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
+ return STYLE_NONE;
+
+ winMultiWindowGetWMName (pWin, &wmName);
+
+ for (i=0; i<pref.styleItems; i++) {
+ if (!strcmp(pref.style[i].match, res_name) ||
+ !strcmp(pref.style[i].match, res_class) ||
+ (wmName && strstr(wmName, pref.style[i].match)))
+ {
+ free (res_name);
+ free (res_class);
+ if (wmName)
+ free (wmName);
+
+ if (pref.style[i].type)
+ return pref.style[i].type;
+ }
+ }
+
+ /* Didn't find the style, fail gracefully */
+ free (res_name);
+ free (res_class);
+ if (wmName)
+ free (wmName);
+
+ return STYLE_NONE;
+}
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
index d9e09de..996b02a 100644
--- a/hw/xwin/winprefs.h
+++ b/hw/xwin/winprefs.h
@@ -2,6 +2,7 @@
#define WINPREFS_H
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
/* Need Bool */
@@ -57,6 +59,15 @@ typedef enum MENUCOMMANDTYPE
CMD_RELOAD /* Reparse the .XWINRC file */
} MENUCOMMANDTYPE;
+#define STYLE_NONE (0L) /* Dummy the first entry */
+#define STYLE_NOTITLE (1L) /* Force window style no titlebar */
+#define STYLE_OUTLINE (1L<<1) /* Force window style just thin-line border */
+#define STYLE_NOFRAME (1L<<2) /* Force window style no frame */
+#define STYLE_TOPMOST (1L<<3) /* Open a window always-on-top */
+#define STYLE_MAXIMIZE (1L<<4) /* Open a window maximized */
+#define STYLE_MINIMIZE (1L<<5) /* Open a window minimized */
+#define STYLE_BOTTOM (1L<<6) /* Open a window at the bottom of the Z order */
+
/* Where to place a system menu */
typedef enum MENUPOSITION
{
@@ -97,6 +108,13 @@ typedef struct ICONITEM
unsigned long hicon; /* LoadImage() result */
} ICONITEM;
+/* To redefine styles for certain window types */
+typedef struct STYLEITEM
+{
+ char match[MENU_MAX+1]; /* What string to search for? */
+ unsigned long type; /* What should it do? */
+} STYLEITEM;
+
typedef struct WINPREFS
{
/* Menu information */
@@ -122,6 +140,9 @@ typedef struct WINPREFS
ICONITEM *icon;
int iconItems;
+ STYLEITEM *style;
+ int styleItems;
+
/* Silent exit flag */
Bool fSilentExit;
@@ -155,6 +176,9 @@ unsigned long
winOverrideIcon (unsigned long longpWin);
unsigned long
+winOverrideStyle (unsigned long longpWin);
+
+unsigned long
winTaskbarIcon(void);
unsigned long
diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
index a4c1abc..ee2478b 100644
--- a/hw/xwin/winprefslex.l
+++ b/hw/xwin/winprefslex.l
@@ -1,6 +1,7 @@
%{ # -*- C -*-
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -27,6 +28,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
/* $XFree86: $ */
@@ -70,6 +72,14 @@ MENU { return MENU; }
ICONDIRECTORY { return ICONDIRECTORY; }
DEFAULTICON { return DEFAULTICON; }
ICONS { return ICONS; }
+STYLES { return STYLES; }
+TOPMOST { return TOPMOST; }
+MAXIMIZE { return MAXIMIZE; }
+MINIMIZE { return MINIMIZE; }
+BOTTOM { return BOTTOM; }
+NOTITLE { return NOTITLE; }
+OUTLINE { return OUTLINE; }
+NOFRAME { return NOFRAME; }
ROOTMENU { return ROOTMENU; }
DEFAULTSYSMENU { return DEFAULTSYSMENU; }
SYSMENU { return SYSMENU; }
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
index 2a54ff2..0c27751 100644
--- a/hw/xwin/winprefsyacc.y
+++ b/hw/xwin/winprefsyacc.y
@@ -1,6 +1,7 @@
%{
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -27,6 +28,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
/* $XFree86: $ */
@@ -41,6 +43,10 @@
/* The following give better error messages in bison at the cost of a few KB */
#define YYERROR_VERBOSE 1
+/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */
+#define YYLTYPE_IS_TRIVIAL 1
+#define YYENABLE_NLS 0
+
/* The global pref settings */
WINPREFS pref;
@@ -64,6 +70,10 @@ static void OpenIcons(void);
static void AddIconLine(char *matchstr, char *iconfile);
static void CloseIcons(void);
+static void OpenStyles(void);
+static void AddStyleLine(char *matchstr, unsigned long style);
+static void CloseStyles(void);
+
static void OpenSysMenu(void);
static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
static void CloseSysMenu(void);
@@ -78,14 +88,19 @@ extern int yylex(void);
%union {
char *sVal;
+ unsigned long uVal;
int iVal;
}
-%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS DEFAULTSYSMENU
+%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS STYLES
+%token TOPMOST MAXIMIZE MINIMIZE BOTTOM NOTITLE OUTLINE NOFRAME DEFAULTSYSMENU
%token SYSMENU ROOTMENU SEPARATOR ATSTART ATEND EXEC ALWAYSONTOP DEBUG
%token RELOAD TRAYICON SILENTEXIT
%token <sVal> STRING
+%type <uVal> group1
+%type <uVal> group2
+%type <uVal> stylecombo
%type <iVal> atspot
%%
@@ -107,6 +122,7 @@ command: defaulticon
| icondirectory
| menu
| icons
+ | styles
| sysmenu
| rootmenu
| defaultsysmenu
@@ -154,6 +170,33 @@ iconlist: iconline
icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();}
;
+group1: TOPMOST { $$=STYLE_TOPMOST; }
+ | MAXIMIZE { $$=STYLE_MAXIMIZE; }
+ | MINIMIZE { $$=STYLE_MINIMIZE; }
+ | BOTTOM { $$=STYLE_BOTTOM; }
+ ;
+
+group2: NOTITLE { $$=STYLE_NOTITLE; }
+ | OUTLINE { $$=STYLE_OUTLINE; }
+ | NOFRAME { $$=STYLE_NOFRAME; }
+ ;
+
+stylecombo: group1 { $$=$1; }
+ | group2 { $$=$1; }
+ | group1 group2 { $$=$1|$2; }
+ | group2 group1 { $$=$1|$2; }
+ ;
+
+styleline: STRING stylecombo NEWLINE newline_or_nada { AddStyleLine($1, $2); free($1); }
+ ;
+
+stylelist: styleline
+ | styleline stylelist
+ ;
+
+styles: STYLES LB {OpenStyles();} newline_or_nada stylelist RB {CloseStyles();}
+ ;
+
atspot: { $$=AT_END; }
| ATSTART { $$=AT_START; }
| ATEND { $$=AT_END; }
@@ -316,6 +359,39 @@ CloseIcons (void)
}
static void
+OpenStyles (void)
+{
+ if (pref.style != NULL) {
+ ErrorF("LoadPreferences: Redefining window style\n");
+ free(pref.style);
+ pref.style = NULL;
+ }
+ pref.styleItems = 0;
+}
+
+static void
+AddStyleLine (char *matchstr, unsigned long style)
+{
+ if (pref.style==NULL)
+ pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM));
+ else
+ pref.style = (STYLEITEM*)
+ realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
+
+ strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX);
+ pref.style[pref.styleItems].match[MENU_MAX] = 0;
+
+ pref.style[pref.styleItems].type = style;
+
+ pref.styleItems++;
+}
+
+static void
+CloseStyles (void)
+{
+}
+
+static void
OpenSysMenu (void)
{
if (pref.sysMenu != NULL) {
commit 847a91ad2e8c9b0992c09f0ec38466885d6d25d4
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Jan 4 19:57:56 2009 +0000
Xming: Notify X when the keyboard focus is lost to a pure Windows window in -multiwindow mode.
Fix internal WM to notify X when the keyboard focus is lost to a pure Windows window in -multiwindow mode.
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 7ebe42f..b5e789c 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -678,6 +678,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
/* Remove our keyboard hook if it is installed */
winRemoveKeyboardHookLL ();
+ if (!wParam)
+ /* Revert the X focus as well, but only if the Windows focus is going to another window */
+ DeleteWindowFromAnyEvents(pWin, FALSE);
return 0;
case WM_SYSDEADCHAR:
commit 6c3e7e4d0568ecb7d10b814593bbbd817b7d2aab
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Jan 4 18:28:34 2009 +0000
Xming: Only allow WM_MOUSEWHEEL messages to act on the client area of a focused window.
Fix internal WM so it only allows WM_MOUSEWHEEL messages to act on the client area of a focused window.
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 8b2a145..7ebe42f 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -647,10 +647,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam);
case WM_MOUSEWHEEL:
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
+ if (SendMessage(hwnd, WM_NCHITTEST, 0, MAKELONG(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))) == HTCLIENT)
+ {
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+ return 0;
+ }
+ else break;
case WM_SETFOCUS:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
commit d84e0e387764236c7e97509baf4606d96cfc19d4
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Jan 4 18:20:44 2009 +0000
Xming: Correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created.
Fix internal WM to correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created,
and to de-iconize parent windows when a child window acquires focus.
XXX: Perhaps we should also shuffle parent(s) forward through Z-order when a child acquires focus?
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 313bd7d..18dba23 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
* Authors: Kensuke Matsuzaki
* Earle F. Philhower, III
* Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -476,6 +478,7 @@ winCreateWindowsWindow (WindowPtr pWin)
int iWidth;
int iHeight;
HWND hWnd;
+ HWND hFore = NULL;
WNDCLASSEX wc;
winWindowPriv(pWin);
HICON hIcon;
@@ -486,6 +489,7 @@ winCreateWindowsWindow (WindowPtr pWin)
static int s_iWindowID = 0;
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints;
+ WindowPtr pDaddy;
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
@@ -560,6 +564,15 @@ winCreateWindowsWindow (WindowPtr pWin)
wc.lpszClassName = pszClass;
RegisterClassEx (&wc);
+ if (winMultiWindowGetTransientFor (pWin, &pDaddy))
+ {
+ if (pDaddy)
+ {
+ hFore = GetForegroundWindow();
+ if (hFore && (pDaddy != (WindowPtr)GetProp(hFore, WIN_WID_PROP))) hFore = NULL;
+ }
+ }
+
/* Create the window */
/* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
/* CW_USEDEFAULT, change back to popup after creation */
@@ -571,7 +584,7 @@ winCreateWindowsWindow (WindowPtr pWin)
iY, /* Vertical position */
iWidth, /* Right edge */
iHeight, /* Bottom edge */
- (HWND) NULL, /* No parent or owner window */
+ hFore, /* Null or Parent window if transient*/
(HMENU) NULL, /* No menu */
GetModuleHandle (NULL), /* Instance handle */
pWin); /* ScreenPrivates */
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 1ea6959..8b2a145 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
* Authors: Kensuke Matsuzaki
* Earle F. Philhower, III
* Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -654,6 +656,12 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
+ {
+ /* Get the parent window for transient handling */
+ HWND hParent = GetParent(hwnd);
+ if (hParent && IsIconic(hParent)) ShowWindow (hParent, SW_RESTORE);
+ }
+
winRestoreModeKeyStates ();
/* Add the keyboard hook if possible */
commit 8d82d806ee38d45ec7cdbf8b1f671ec1e4437567
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Sun Nov 2 20:46:38 2008 +0000
Xming: Correct the way display and screen number is reported in window titles and tooltips
Correct the tooltip text for the toolbar X icon to be strictly correct, 'display-number:screen' should be ':display-number.screen'.
Also for the default window title.
Adjust the style of the Windows title in XDMCP mode from 'Xming - hostname' to 'hostname:display-number.screen'.
Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/
http://sourceforge.net/projects/xming/
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index 796a085..85b6cf8 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -88,7 +88,9 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
+ g_pszQueryHost,
+ display,
+ (int) pScreenInfo->dwScreen);
else
snprintf (szTitle,
sizeof (szTitle),
@@ -331,7 +333,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
+ g_pszQueryHost,
+ display,
+ (int) pScreenInfo->dwScreen);
else
snprintf (szTitle,
sizeof (szTitle),
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
index 054a8e9..d1a7b4d 100755
--- a/hw/xwin/wintrayicon.c
+++ b/hw/xwin/wintrayicon.c
@@ -59,7 +59,7 @@ winInitNotifyIcon (winPrivScreenPtr pScreenPriv)
/* Set display and screen-specific tooltip text */
snprintf (nid.szTip,
sizeof (nid.szTip),
- PROJECT_NAME " Server - %s:%d",
+ PROJECT_NAME " Server:%s.%d",
display,
(int) pScreenInfo->dwScreen);
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 9c49d64..38db55f 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -42,8 +42,8 @@
# define PROJECT_NAME "Cygwin/X"
#endif
#define WINDOW_CLASS "cygwin/x"
-#define WINDOW_TITLE PROJECT_NAME " - %s:%d"
-#define WINDOW_TITLE_XDMCP PROJECT_NAME " - %s"
+#define WINDOW_TITLE PROJECT_NAME ":%s.%d"
+#define WINDOW_TITLE_XDMCP "%s:%s.%d"
#define WIN_SCR_PROP "cyg_screen_prop rl"
#define WINDOW_CLASS_X "cygwin/x X rl"
#define WINDOW_TITLE_X PROJECT_NAME " X"
commit 656f92e247f2f257105daf1e0e6998e1b3d10eba
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Sun Nov 2 20:17:02 2008 +0000
Cygwin/X: should also use GetTickCount(), just like Xming
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/os/utils.c b/os/utils.c
index b630d9d..55f8a98 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -56,6 +56,11 @@ OR PERFORMANCE OF THIS SOFTWARE.
#ifdef __CYGWIN__
#include <stdlib.h>
#include <signal.h>
+/*
+ Sigh... We really need a prototype for this to know it is stdcall,
+ but #include-ing <windows.h> here is not a good idea...
+*/
+__stdcall unsigned long GetTickCount(void);
#endif
#if defined(WIN32) && !defined(__CYGWIN__)
@@ -422,7 +427,7 @@ GiveUp(int sig)
errno = olderrno;
}
-#if defined WIN32 && defined __MINGW32__
+#if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__)
CARD32
GetTimeInMillis (void)
{
commit 7f781e780ee2b261c5cb688a8e6c5dc1a53bdb6f
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date: Wed Dec 17 19:13:30 2008 +0000
Cygwin/X: Cygwin doesn't have RTLD_LOCAL
RTLD_LOCAL is not defined on Cygwin
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 5b3ecb0..de89d38 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -55,6 +55,13 @@
#include "dispatch.h"
#include "extension_string.h"
+/* RTLD_LOCAL is not defined on Cygwin */
+#ifdef __CYGWIN__
+#ifndef RTLD_LOCAL
+#define RTLD_LOCAL 0
+#endif
+#endif
+
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
More information about the xorg-commit
mailing list