Diff of hacked-up patch to make X11 windows come to the front
Diff of hacked-up patch to make X11 windows come to the front
- Subject: Diff of hacked-up patch to make X11 windows come to the front
- From: William Mortensen <email@hidden>
- Date: Thu, 1 Nov 2007 22:55:54 -0700
Hi there,
Remembering that 10.4.3 fixed this problem, I diff'ed its X11 with
10.4.2's and noticed that they added a new function that gets called
every time X11 is brought to the front. I then spent a little time
trying to fit it into the new source. Not knowing anything about X or
Quartz programming, I'm sure pretty much everything about it is wrong,
but it does seem to work (at least for me). :-)
Hope this is helpful to somebody.
Here's the diff from 10.4.2 to 10.4.3:
diff -r X11-0.40/xc/extras/Xpm/lib/create.c X11-0.40.2/xc/extras/Xpm/
lib/create.c
1d0
< /* $XdotOrg: pre-CVS proposed fix for CESA-2004-003 alanc 7/25/2004
$ */
997a997,1005
> if ((*image_return)->bitmap_unit < 0 ||
> (*image_return)->bitmap_unit > 32 ||
> (*image_return)->depth < 0 || (*image_return)->depth > 32 ||
> (*image_return)->bits_per_pixel < 0 ||
> (*image_return)->bits_per_pixel > 32) {
> XDestroyImage(*image_return);
> return (XpmNoMemory);
> }
>
1218c1226,1227
< register unsigned int x, y, i;
---
> register unsigned int x, y;
> int i;
diff -r X11-0.40/xc/extras/Xpm/lib/scan.c X11-0.40.2/xc/extras/Xpm/lib/
scan.c
281a282,285
> if (image->depth < 0 || image->depth > 32 ||
> image->bits_per_pixel < 0 || image->bits_per_pixel > 32 ||
> image->bitmap_unit < 0 || image->bitmap_unit > 32)
> return (XpmNoMemory);
624c628,629
< unsigned int x, y, i;
---
> unsigned int x, y;
> int i;
Only in X11-0.40.2/xc/programs/Xserver/hw: .DS_Store
diff -r X11-0.40/xc/programs/Xserver/hw/apple/X11.pbproj/
project.pbxproj X11-0.40.2/xc/programs/Xserver/hw/apple/X11.pbproj/
project.pbxproj
274c274
< <string>1.1</string>
---
> <string>1.1.1</string>
diff -r X11-0.40/xc/programs/Xserver/hw/apple/X11Application.m
X11-0.40.2/xc/programs/Xserver/hw/apple/X11Application.m
2c2
< $Id: X11Application.m,v 1.55 2004/10/22 00:59:33 jharper Exp $
---
> $Id: X11Application.m,v 1.55.2.1 2005/08/10 18:12:46 jharper Exp $
316a317,319
>
> if ([e data2] & 0x10)
> QuartzMessageMainThread (kXquartzBringAllToFront, 0);
996c999,1000
< int pointer_x, pointer_y, count;
---
> int pointer_x, pointer_y;
> float count;
1090,1091c1094,1095
< xe.u.u.detail = count > 0 ? 4 : 5;
< for (count = abs (count); count-- > 0;)
---
> xe.u.u.detail = count > 0.0f ? 4 : 5;
> for (count = fabs (count); count > 0.0; count = count - 1.0f)
diff -r X11-0.40/xc/programs/Xserver/hw/apple/quartz.c X11-0.40.2/xc/
programs/Xserver/hw/apple/quartz.c
702a703,707
> break;
>
> case kXquartzBringAllToFront:
> RootlessOrderAllWindows ();
> break;
diff -r X11-0.40/xc/programs/Xserver/hw/apple/quartz.h X11-0.40.2/xc/
programs/Xserver/hw/apple/quartz.h
51a52
> kXquartzBringAllToFront,
diff -r X11-0.40/xc/programs/Xserver/hw/apple/rootless-window.c
X11-0.40.2/xc/programs/Xserver/hw/apple/rootless-window.c
717a718,749
> RootlessOrderAllWindows (void)
> {
> int i;
> ScreenPtr pScreen;
> WindowPtr pWin;
> RootlessWindowRec *winRec;
>
> if (windows_hidden)
> return;
>
> for (i = 0; i < screenInfo.numScreens; i++)
> {
> pScreen = screenInfo.screens[i];
> pWin = WindowTable[i];
> if (pScreen == NULL || pWin == NULL)
> continue;
>
> for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
> {
> if (!pWin->realized)
> continue;
>
> winRec = rootlessEnsureFrame (pWin);
> if (winRec == NULL)
> continue;
>
> RootlessReorderWindow (pWin);
> }
> }
> }
>
> void
diff -r X11-0.40/xc/programs/Xserver/hw/apple/rootless.h X11-0.40.2/xc/
programs/Xserver/hw/apple/rootless.h
59a60
> extern void RootlessOrderAllWindows (void);
And the relevant parts of the diff from the 1.2a3 I got off
freedesktop.org to my new version:
diff -r xorg-server-1.2a3_orig/hw/darwin/apple/X11Application.m xorg-
server-1.2a3/hw/darwin/apple/X11Application.m
365a366
> {
366a368,369
> QuartzMessageServerThread(kXDarwinBringAllToFront, 0);
> }
diff -r xorg-server-1.2a3_orig/hw/darwin/darwin.h xorg-server-1.2a3/hw/
darwin/darwin.h
150c150,151
< kXDarwinWindowMoved // window has moved on screen
---
> kXDarwinWindowMoved, // window has moved on screen
> kXDarwinBringAllToFront
diff -r xorg-server-1.2a3_orig/hw/darwin/quartz/quartz.c xorg-
server-1.2a3/hw/darwin/quartz/quartz.c
402a403,406
> case kXDarwinBringAllToFront:
> RootlessOrderAllWindows();
> break;
>
diff -r xorg-server-1.2a3_orig/miext/rootless/rootless.h xorg-
server-1.2a3/miext/rootless/rootless.h
434a435,436
> extern void RootlessOrderAllWindows (void);
>
diff -r xorg-server-1.2a3_orig/miext/rootless/rootlessWindow.c xorg-
server-1.2a3/miext/rootless/rootlessWindow.c
1417a1418,1451
> void
> RootlessOrderAllWindows (void)
> {
> int i;
> ScreenPtr pScreen;
> WindowPtr pWin;
> RootlessWindowRec *winRec;
>
> // 10.4.3's X11 had this windows_hidden variable in this file,
but
> // 10.5's doesn't seem to. Commenting it out works for now.
> //if (windows_hidden)
> //return;
>
> for (i = 0; i < screenInfo.numScreens; i++)
> {
> pScreen = screenInfo.screens[i];
> pWin = WindowTable[i];
> if (pScreen == NULL || pWin == NULL)
> continue;
>
> for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib)
> {
> if (!pWin->realized)
> continue;
>
> winRec = RootlessEnsureFrame (pWin);
> if (winRec == NULL)
> continue;
>
> RootlessReorderWindow (pWin);
> }
> }
> }
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden