Re: [PATCH] Default to use standard fonts and builtin fonts as a fallback

2009-01-07 Thread Nicolas Mailhot

Hi,

From a totally human and not technical POW, it would be great if use
of core fonts, especially *failing* use of core fonts, resulted in a
warning telling people to fontconfig-ify their apps.

I'd rather have users pester application authors/ISVs so they move to
the current millenium rather than having them hammer xorg and distro
lists to make core fonts work perfectly (which was never the case and
is unlikely to ever happen at this stage).

A lot of old *nix users have totally missed the fact fontconfig
happened, and need some education.

Regards,

-- 
Nicolas Mailhot

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Converting kdrive server to Xorg driver

2009-01-07 Thread Graeme Gregory
Hi, I have been trying to convert a kdrive server for the freerunner
phone into an Xorg driver and I have one small question that I can't
seem to answer myself from TFM.

This is on an arm device if that makes any difference.

Is the following code in kdrive

reg_base = (char *)KdMapDevice(0x800, 0x2400);
KdSetMappedMode(0x800, 0x2400, KD_MAPPED_MODE_REGISTERS);

equivalent to this code in Xorg?

reg_base = xf86MapVidMem(pScreen-myNum, VIDMEM_MMIO, 0x800, 0x2400);

Thanks

Graeme

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: EXA and migration [was: shrink xrender featureset]

2009-01-07 Thread Michel Dänzer
On Tue, 2009-01-06 at 22:08 +0100, Clemens Eisserer wrote:
 Hi Michael,

Ahem. ;)

  I can definitely see how diagonal lines would cause migration ping-pong,
  but for gradients without blending, as of xserver 1.6 they should just
  get rendered by the CPU to the system memory copy without any previous
  migration necessary. If you're not seeing that, please provide more
  information.
 
 Is this also the case when a mask is used for composition?

Hmm, I think you've just made me realize a bug in
ExaCheckComposite(). :( The way it's currently implemented, mask or no
mask doesn't matter, only whether the composite operation itself reads
from the destination does. However, of course with a mask the result may
depend on the previous destination contents regardless, so the migration
would indeed be necessary in that case. Maybe this is behind some of the
EXA rendering corruption bug reports I haven't been able to reproduce...

 If this is the case, what would be the drawbacks to use a temporary
 pixmap to avoid migrating out of VRAM?

It's hard to say without trying it.


-- 
Earthling Michel Dänzer   |http://www.vmware.com
Libre software enthusiast |  Debian, X and DRI developer
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: Floats in the protocol

2009-01-07 Thread Simon Thum
 On XDS 08, Keith suggested simply putting them on the wire. That is,
 require IEEE756 32 bit and account for endianness.
 GLX already uses both 32 and 64 bit IEEE floats on the wire, so I don't
 see any reason to use something different here.

 I'd like to add floats to the render protocol as well, mostly for
 matrices where fixed point values cause significant errors.

 
[...]
 KISS: let's go with IEEE
   - Jim
I'd say that is settled. In the input prop case, there will probably be
a single junction (at least on the server-side) which could be used to
check for bombs should issues arise.

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: [multiseat] hard freeze when running X -arguments... :1

2009-01-07 Thread Daniel Stone
On Mon, Jan 05, 2009 at 07:43:04AM +0100, Tomasz Chmielewski wrote:
 Tiago Vignatti schrieb:
  So far I have one problem: my computer freezes whenever I want to use 
  GDM as a desktop manager. On the other hand, everything works fine if 
  I use KDM.
 
  Closer investigation turned up that the freeze does not really depend 
  on the desktop manager, but on the order X servers are started.
  
  Some days ago I answered to you in what mess we're living (search for 
  494ee380.1040...@c3sl.ufpr.br). You won't be able to initialize more 
  than one X server so soon.
 
 Not being able to initialize more than one X server doesn't sound like 
 a right direction of development to me, or?

'Direction of development' and 'current unfortunate reality' are two
entirely different things.  We're working on it; patches would be more
than welcome: kernel modesetting and VGA arbitration are currently works
in progress (at least, for Linux), and we'd more than welcome help with
both.

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [news] TWM -- Revised Edition

2009-01-07 Thread Daniel Stone
On Tue, Jan 06, 2009 at 12:10:43PM +0100, Eeri Kask wrote:
 Sincere thank you for the offer.  If TWM users don't object I would
 apply for an account in a short while and piecewise carry over all
 improvements then.
 
 Essential features have been ported to vtwm as well and we are currently
 in the middle of making these bulletproof there first/as well.  (In the
 meantime I have to learn how to access and work with the Xorg repository.)

Oh, cool! I don't think anyone will complain. :)

Instructions are on 
http://www.freedesktop.org/wiki/Infrastructure/git/Developers

The relevant repo is git://anongit.freedesktop.org/git/xorg/app/twm or
ssh://git.freedesktop.org/git/xorg/app/twm

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[PATCH] xkb: Set sane build time XKB defaults

2009-01-07 Thread Dan Nicholson
Previously, DIX set the default XKB rules to base, pc105, us during
initialization. That has now been moved to the DDX in 9c5dd733, but only
covers Xorg. This makes the builtin XKB match the previous DIX defaults.
Also changes the fallback XKB path match the typical location, although
XKB_BASE_DIRECTORY is always set during configure.

Signed-off-by: Dan Nicholson dbn.li...@gmail.com
---
 I think this is also needed for server-1.6-branch since this affects all
 the non-Xorg DDX there, too.

 xkb/xkbInit.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 5f51c45..3f07af5 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -86,7 +86,7 @@ typedef struct_SrvXkmInfo {
 /******/
 
 #ifndef XKB_BASE_DIRECTORY
-#defineXKB_BASE_DIRECTORY  /usr/lib/X11/xkb
+#defineXKB_BASE_DIRECTORY  /usr/share/X11/xkb
 #endif
 #ifndef XKB_BIN_DIRECTORY
 #defineXKB_BIN_DIRECTORY   XKB_BASE_DIRECTORY
@@ -98,7 +98,7 @@ typedef struct_SrvXkmInfo {
 #defineXKB_DFLT_KB_LAYOUT  us
 #endif
 #ifndef XKB_DFLT_KB_MODEL
-#defineXKB_DFLT_KB_MODEL   dflt
+#defineXKB_DFLT_KB_MODEL   pc105
 #endif
 #ifndef XKB_DFLT_KB_VARIANT
 #defineXKB_DFLT_KB_VARIANT NULL
-- 
1.5.6.6

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Converting kdrive server to Xorg driver

2009-01-07 Thread CooperYuan Cooper
sure, the two methods will call mmap function to map memory with
shared and no-cached flag.

On Wed, Jan 7, 2009 at 6:48 PM, Graeme Gregory gra...@openmoko.org wrote:
 Hi, I have been trying to convert a kdrive server for the freerunner
 phone into an Xorg driver and I have one small question that I can't
 seem to answer myself from TFM.

 This is on an arm device if that makes any difference.

 Is the following code in kdrive

 reg_base = (char *)KdMapDevice(0x800, 0x2400);
 KdSetMappedMode(0x800, 0x2400, KD_MAPPED_MODE_REGISTERS);

 equivalent to this code in Xorg?

 reg_base = xf86MapVidMem(pScreen-myNum, VIDMEM_MMIO, 0x800, 0x2400);

 Thanks

 Graeme

 ___
 xorg mailing list
 xorg@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/xorg

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


exclude programs from input device grabs

2009-01-07 Thread Patrick Sebastian Zimmermann
Hello,
this is my first post to this list, so hi everyone.

I'd like to program a mechanism for the xserver that allows certain
programs to recieve input events even when they are grabbed by another
program. This would allow X keygrabbers to work even when other
programs grabbed the keyboard (eg. most programs when having a menu
open, and most games).

Since this bears a certain security risk (a malicious keygrabber
can overhear all entered passwords), I'm not sure if
such a feature would be accepted.

Is there any chance for somethink like this to get into the tree?
Any other ideas?

Greetings,
Patrick


signature.asc
Description: PGP signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [PATCH] xkb: Set sane build time XKB defaults

2009-01-07 Thread Daniel Stone
On Wed, Jan 07, 2009 at 06:14:44AM -0800, Dan Nicholson wrote:
 Previously, DIX set the default XKB rules to base, pc105, us during
 initialization. That has now been moved to the DDX in 9c5dd733, but only
 covers Xorg. This makes the builtin XKB match the previous DIX defaults.
 Also changes the fallback XKB path match the typical location, although
 XKB_BASE_DIRECTORY is always set during configure.

NAK of sorts: I'd like to fix this properly.  In particular, hardcoded
paths are not the way.

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [PATCHES] improve gamma support for randr-1.2 drivers

2009-01-07 Thread Shunichi Fuji
hi, some application say like below

..XFree86-VidMode Extension Version 2.2
..XFree86-Xinerama Extension Version 1.1
..Got colorbits 24, depthbits 24, stencilbits 8
...setting mode 3:
X Error of failed request:  BadValue (integer parameter out of range for 
operation)
  Major opcode of failed request:  129 (XFree86-VidModeExtension)
  Minor opcode of failed request:  17 (XF86VidModeGetGammaRamp)
  Value in failed request:  0x27
  Serial number of failed request:  61
  Current serial number in output stream:  61

per crtc gamma support goes well, BTW per screen support seems somehow break 
now.

how do you like that 
base screen gamma(old colourmap system?) + per crtc gamma bias(randr parameter)?
i'm not sure, most situation that needs this support is clone-mode? 


On Tue, 16 Dec 2008 22:07:37 +0100
Maarten Maathuis madman2...@gmail.com wrote:

 These two patches should accomplish the following:
 
 - Usage of Gamma in xorg.conf will be associated with an output and set 
 on the initial crtc.
(This should work as good as possible for clone modes, eg a non-1.0 
 gamma will not be overwritten with a standard value)
 - Gamma is stored from preinit and between server generations.
 - The old colourmap system will be disabled if gamma hook is available.
 - xrandr can now set gamma.
 
 My main question is, are there any xserver ABI's to bump due to the 
 changes to the xf86CrtcRec struct?
 
 Maarten.
 
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: [PATCH] xkb: Set sane build time XKB defaults

2009-01-07 Thread Dan Nicholson
On Wed, Jan 7, 2009 at 7:44 AM, Daniel Stone dan...@fooishbar.org wrote:
 On Wed, Jan 07, 2009 at 06:14:44AM -0800, Dan Nicholson wrote:
 Previously, DIX set the default XKB rules to base, pc105, us during
 initialization. That has now been moved to the DDX in 9c5dd733, but only
 covers Xorg. This makes the builtin XKB match the previous DIX defaults.
 Also changes the fallback XKB path match the typical location, although
 XKB_BASE_DIRECTORY is always set during configure.

 NAK of sorts: I'd like to fix this properly.  In particular, hardcoded
 paths are not the way.

Sure. However, as it stands on both master and 1.6-branch, all the DDX
except Xorg start with these defaults. So, they have an invalid
default model of dflt as far as I can tell. Also, the
XKB_BASE_DIRECTORY setting could be dropped from this patch. It's
always defined in configure, so the hardcoded /usr/share/X11/xkb
should never actually get used.

What did you have in mind to fix this properly?

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re:

2009-01-07 Thread Dan Nicholson
On Tue, Jan 6, 2009 at 1:47 PM, Fabio f...@ferrara.linux.it wrote:

 Hi all,

 I am having a strange problem and I can't find any help either googling or
 on the x.org site.

 I have just bought a new pc: the components are

 CPU: intel core2duo with 4 Gb of RAM
 MB: asus p5ql-em
 VGA: intel g43 (integrated on the MB)
 Monitor: asus vw198s

 I installed ubuntu 8.10 (amd64).

 The first problem is that the correct resolution of the monitor
 (1680x1050) is not recognized out of the box: after installation, it ran
 at a lower resolution (1360x768) and I was not able to change it.
 This surprised me.
 I couldn't find on the net a valid modeline for my monitor, so
 I followed the instructions on
 http://www.x.org/wiki/FAQVideoModes#head-82230a582646cbf28ac41dec2139732ee868e0d2
 to obtain a valid modeline using powerstrip.
 I got the following

 Modeline 1680x1050 147.600 1680 1784 1968 2256 1050 1051 1054 1087 -hsync 
 +vsync

 Is this ok? It looks like, since I put it into /etc/X11/xorg.conf
 and, this way, the resolution is correct.

I'm not sure if the bug is because of the intel driver or because of
the monitor. It would probably help to attach Xorg.0.log from the
failed attempt before you added the Modeline. It might also be
interesting to look at the output from xrandr -q which shows what
modes X thinks are available.

 But now it comes another problem: sometime (not everytime) when I logout
 to change user instead of the usual gdm greeting I get that the monitor
 has no signal and goes automatically in poweroff: the only thing that I
 can do is an hard reboot of the pc.
 I can't understand the origin of this problem.

There have been bugs with VT switching on intel recently. These are
being fixed, so it may be best here to file a bug with Ubuntu and wait
for the fixes to flow down.

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[ANNOUNCE] xf86-input-keyboard 1.3.2

2009-01-07 Thread Paulo César Pereira de Andrade
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam Jackson (2):
  Remove XFree86-Misc leftovers.
  Remove useless call to xf86AddModuleInfo

Alan Coopersmith (2):
  sun_kbd.c: Don't try to repeat shutdown actions on already closed
keyboard
  Renamed subdir .cvsignore files to .gitignore

Kristian Høgsberg (1):
  Move atKeynames.h and xf86CommonSpecialKey() here.

Luc Verhaegen (1):
  Set TERMINATE_FALLBACK to 0.

Paulo Cesar Pereira de Andrade (1):
  Update for servers newer then 1.5 or git master.

git tag: xf86-input-keyboard-1.3.2

http://xorg.freedesktop.org/archive/individual/driver/xf86-input-keyboard-1.3.2.tar.bz2
MD5: d6fe929c4f6085d6dd67f197ae9c42f6  xf86-input-keyboard-1.3.2.tar.bz2
SHA1: 81d35fedef7b809b35297935330ddc8743005512 
xf86-input-keyboard-1.3.2.tar.bz2

http://xorg.freedesktop.org/archive/individual/driver/xf86-input-keyboard-1.3.2.tar.gz
MD5: 7d1d00929e2929db9ade3b0844b70c68  xf86-input-keyboard-1.3.2.tar.gz
SHA1: e208c1ef4e2cac8d29e0adb1f6fe3f1f5d332e50 
xf86-input-keyboard-1.3.2.tar.gz

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAklk46IACgkQPdKBRUa20MD3AgCfab2g46/F/wtVGrkh7MM1HnEm
gVEAnRfHnz3qzf/LpEkv/Dmg7pJLmq7A
=Jmpp
-END PGP SIGNATURE-

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 05/13] Xming: Only allow WM_MOUSEWHEEL messages to act on the client area of a focused window.

2009-01-07 Thread Jon TURNEY
From: Colin Harrison colin.harri...@virgin.net

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.tur...@dronecode.org.uk
---
 hw/xwin/winmultiwindowwndproc.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 3fc3cce..3104a85 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -648,10 +648,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)
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 01/13] Cygwin/X: Cygwin doesn't have RTLD_LOCAL

2009-01-07 Thread Jon TURNEY
From: Yaakov Selkowitz yselkow...@users.sourceforge.net

RTLD_LOCAL is not defined on Cygwin

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 glx/glxdriswrast.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

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;
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 12/13] Cygwin/X: Fix the keyboard mode key synchronization

2009-01-07 Thread Jon TURNEY
Fix the code which generates fake keypresses when an X window gains focus to
bring the X servers idea of the state of these mode keys in to sync with any
changes which might have taken place whilst unfocused.

With MPX changes, the place the server stores the current mode key state has
changed, appears they are now only held on the virtual core keyboard.

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 hw/xwin/winkeybd.c |   15 ---
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 24a7b43..0c07c2f 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -49,10 +49,6 @@
 
 static Bool g_winKeyState[NUM_KEYCODES];
 
-/* Stored to get internal mode key states.  Must be read-only.  */
-static unsigned short const *g_winInternalModeKeyStatesPtr = NULL;
-
-
 /*
  * Local prototypes
  */
@@ -209,7 +205,6 @@ winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
 static void
 winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
 {
-  g_winInternalModeKeyStatesPtr = (pDevice-key-state);
 }
 
 
@@ -297,19 +292,15 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
 }
 }
 #endif
-
-  g_winInternalModeKeyStatesPtr = (pDeviceInt-key-state);
   break;
   
 case DEVICE_ON: 
   pDevice-on = TRUE;
-  g_winInternalModeKeyStatesPtr = (pDeviceInt-key-state);
   break;
 
 case DEVICE_CLOSE:
 case DEVICE_OFF: 
   pDevice-on = FALSE;
-  g_winInternalModeKeyStatesPtr = NULL;
   break;
 }
 
@@ -371,7 +362,7 @@ winRestoreModeKeyStates ()
   unsigned short   internalKeyStates;
 
   /* X server is being initialized */
-  if (!g_winInternalModeKeyStatesPtr)
+  if (!inputInfo.keyboard)
 return;
 
   /* Only process events if the rootwindow is mapped. The keyboard events
@@ -384,7 +375,9 @@ winRestoreModeKeyStates ()
 mieqProcessInputEvents ();
   
   /* Read the mode key states of our X server */
-  internalKeyStates = *g_winInternalModeKeyStatesPtr;
+  /* (stored in the virtual core keyboard) */
+  internalKeyStates = inputInfo.keyboard-key-state;
+  winDebug(winRestoreModeKeyStates: state %d\n, internalKeyStates);
 
   /* 
* NOTE: The C XOR operator, ^, will not work here because it is
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 07/13] Cygwin/X: Correctly allow for the native window frame width in ValidateSizing()

2009-01-07 Thread Jon TURNEY
Fix internal WM to correctly use the current native window style in determining
the native window border when validating window sizing

XXX: Needs to allow for different border thickness when window is uncaptioned?

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 hw/xwin/winmultiwindowwndproc.c |   31 ++-
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 8d8a906..df0f856 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -208,6 +208,7 @@ ValidateSizing (HWND hwnd, WindowPtr pWin,
   WinXSizeHints sizeHints;
   RECT *rect;
   int iWidth, iHeight;
+  unsigned long rcStyle;
 
   /* Invalid input checking */
   if (pWin==NULL || lParam==0)
@@ -229,19 +230,31 @@ ValidateSizing (HWND hwnd, WindowPtr pWin,
   iWidth = rect-right - rect-left;
   iHeight = rect-bottom - rect-top;
 
-  /* Now remove size of any borders */
-  iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
-  iHeight -= (GetSystemMetrics(SM_CYCAPTION)
- + 2 * GetSystemMetrics(SM_CYSIZEFRAME));
- 
+  /* Now remove size of any borders and title bar */
+  rcStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
+  if (rcStyle  WS_CAPTION)
+{
+  iHeight -= GetSystemMetrics(SM_CYCAPTION);
+}
+  if (rcStyle  WS_SIZEBOX)
+{
+  iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
+  iHeight -= 2 * GetSystemMetrics(SM_CYSIZEFRAME);
+}
 
   /* Constrain the size to legal values */
   ConstrainSize (sizeHints, iWidth, iHeight);
 
-  /* Add back the borders */
-  iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
-  iHeight += (GetSystemMetrics(SM_CYCAPTION)
- + 2 * GetSystemMetrics(SM_CYSIZEFRAME));
+  /* Add back the size of borders and title bar */
+  if (rcStyle  WS_CAPTION)
+{
+  iHeight += GetSystemMetrics(SM_CYCAPTION);
+}
+  if (rcStyle  WS_SIZEBOX)
+{
+  iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
+  iHeight += 2 * GetSystemMetrics(SM_CYSIZEFRAME);
+}
 
   /* Adjust size according to where we're dragging from */
   switch(wParam) {
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: problem with monitor asus vw198s

2009-01-07 Thread Fabio

CPU: intel core2duo with 4 Gb of RAM
MB: asus p5ql-em
VGA: intel g43 (integrated on the MB)
Monitor: asus vw198s

I installed ubuntu 8.10 (amd64).

The first problem is that the correct resolution of the monitor
(1680x1050) is not recognized out of the box: after installation, it ran
at a lower resolution (1360x768) and I was not able to change it.
This surprised me.
I couldn't find on the net a valid modeline for my monitor, so
I followed the instructions on
http://www.x.org/wiki/FAQVideoModes#head-82230a582646cbf28ac41dec2139732ee868e0d2
to obtain a valid modeline using powerstrip.
I got the following

Modeline 1680x1050 147.600 1680 1784 1968 2256 1050 1051 1054 1087 -hsync 
+vsync

Is this ok? It looks like, since I put it into /etc/X11/xorg.conf
and, this way, the resolution is correct.


I'm not sure if the bug is because of the intel driver or because of
the monitor. It would probably help to attach Xorg.0.log from the
failed attempt before you added the Modeline. It might also be
interesting to look at the output from xrandr -q which shows what
modes X thinks are available.



I restored the original xorg.conf. The relative Xorg.0.log is attached.
As to xrandr -q, the output is

[coccobill 21:13:28 ~]$ xrandr -q
Screen 0: minimum 320 x 200, current 1152 x 864, maximum 1360 x 1360
VGA connected 1152x864+0+0 (normal left inverted right x axis y axis) 0mm 
x 0mm

   1360x768   59.8
   1152x864   60.0*
   1024x768   60.0
   800x60060.3
   640x48059.9
HDMI-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
[coccobill 21:13:44 ~]$



But now it comes another problem: sometime (not everytime) when I logout
to change user instead of the usual gdm greeting I get that the monitor
has no signal and goes automatically in poweroff: the only thing that I
can do is an hard reboot of the pc.
I can't understand the origin of this problem.


There have been bugs with VT switching on intel recently. These are
being fixed, so it may be best here to file a bug with Ubuntu and wait
for the fixes to flow down.


I made more googling in the afternoon and it seems that the issue is more 
with the framebuffer that with the intel driver.

I had a try removing the fb, that is with options
quiet nosplash video=vesa:off vga=normal
for grub: apparently, the problem disappeared. At least, it didn't 
reproduce for at least 10 login/logout.

(This is why I changed the subject)

Of course I can live without the framebuffer and the splash screen, but
I would prefer if there is a way to recover it ...  :-)

TIA

Fabio
X.Org X Server 1.5.2
Release Date: 10 October 2008
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.24-16-server x86_64 Ubuntu
Current Operating System: Linux coccobill 2.6.27-9-generic #1 SMP Thu Nov 20 
22:15:32 UTC 2008 x86_64
Build Date: 24 October 2008  09:06:49AM
xorg-server 2:1.5.2-2ubuntu3 (bui...@crested.buildd) 
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: /var/log/Xorg.0.log, Time: Wed Jan  7 21:12:39 2009
(==) Using config file: /etc/X11/xorg.conf
(==) No Layout section.  Using the first Screen section.
(**) |--Screen Default Screen (0)
(**) |   |--Monitor Configured Monitor
(**) |   |--Device Configured Video Device
(==) Automatically adding devices
(==) Automatically enabling devices
(==) No FontPath specified.  Using compiled-in default.
(WW) The directory /usr/share/fonts/X11/cyrillic does not exist.
Entry deleted from font path.
(==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType
(==) ModulePath set to /usr/lib/xorg/modules
(II) Cannot locate a core pointer device.
(II) Cannot locate a core keyboard device.
(II) The server relies on HAL to provide the list of input devices.
If no devices become available, reconfigure HAL or disable 
AllowEmptyInput.
(II) Open ACPI successful (/var/run/acpid.socket)
(II) Loader magic: 0x7b7320
(II) Module ABI versions:
X.Org ANSI C Emulation: 0.4
X.Org Video Driver: 4.1
X.Org XInput driver : 2.1
X.Org Server Extension : 1.1
X.Org Font Renderer : 0.6
(II) Loader running on linux
(++) using VT number 7

(--) PCI:*(0...@0:2:0) Intel Corporation 4 Series Chipset Integrated Graphics 
Controller rev 3, Mem @ 0xfe40/4194304, 0xe000/268435456, I/O @ 
0xdc00/8
(--) PCI: (0...@0:2:1) Intel Corporation 4 Series Chipset Integrated Graphics 

[PATCH 02/13] Cygwin/X: should also use GetTickCount(), just like Xming

2009-01-07 Thread Jon TURNEY
Unfortunately, we have to jump through hoops to get this to link properly...

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 configure.ac |1 +
 os/utils.c   |7 ++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9161cba..d8b16fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1553,6 +1553,7 @@ if test x$XWIN = xyes; then
AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for 
signaling new win32 messages])
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
CFLAGS=$CFLAGS -DFD_SETSIZE=256
+   LDFLAGS=$LDFLAGS -Wl,-enable-stdcall-fixup
;;
mingw*)
XWIN_SERVER_NAME=Xming
diff --git a/os/utils.c b/os/utils.c
index a41b0cf..48a1801 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__)
@@ -424,7 +429,7 @@ GiveUp(int sig)
 errno = olderrno;
 }
 
-#if defined WIN32  defined __MINGW32__
+#if (defined WIN32  defined __MINGW32__) || defined(__CYGWIN__)
 CARD32
 GetTimeInMillis (void)
 {
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 03/13] Xming: Correct the way display and screen number is reported in window titles and tooltips

2009-01-07 Thread Jon TURNEY
From: Colin Harrison colin.harri...@virgin.net

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.tur...@dronecode.org.uk
---
 hw/xwin/wincreatewnd.c |8 ++--
 hw/xwin/wintrayicon.c  |2 +-
 hw/xwin/winwindow.h|4 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

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
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 10/13] Cygwin/X: Check window placement to ensure window actually ends up somewhere visible

2009-01-07 Thread Jon TURNEY
Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 hw/xwin/winmultiwindowwindow.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 2399d5a..da8a0a5 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -519,6 +519,13 @@ winCreateWindowsWindow (WindowPtr pWin)
   iWidth = pWin-drawable.width;
   iHeight = pWin-drawable.height;
 
+  /* ensure window actually ends up somewhere visible */
+  if (iX  GetSystemMetrics (SM_CXVIRTUALSCREEN))
+iX = CW_USEDEFAULT;
+
+  if (iY  GetSystemMetrics (SM_CYVIRTUALSCREEN))
+iY = CW_USEDEFAULT;
+
   winSelectIcons(pWin, hIcon, hIconSmall); 
 
   /* Set standard class name prefix so we can identify window easily */
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


RE: xorg Digest, Vol 42, Issue 20

2009-01-07 Thread AretiMixalis Areti Michalis

dont sent me any email please
_
Εξασφαλίστε το ολοκαίνουριο Messenger 2009 τώρα!
http://download.live.com/messenger___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[PATCH 09/13] Xming: Add styles keyword and attributes.

2009-01-07 Thread Jon TURNEY
From: Colin Harrison colin.harri...@virgin.net

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.tur...@dronecode.org.uk
---
 hw/xwin/XWinrc.man |   77 ---
 hw/xwin/winprefs.c |   48 +
 hw/xwin/winprefs.h |   24 +++
 hw/xwin/winprefslex.l  |   10 ++
 hw/xwin/winprefsyacc.y |   78 +++-
 5 files changed, 231 insertions(+), 6 deletions(-)

diff --git a/hw/xwin/XWinrc.man b/hw/xwin/XWinrc.man
index eba3fb6..0def5e8 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 startor 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 @@ 

[PATCH 06/13] Xming: Notify X when the keyboard focus is lost to a pure Windows window in -multiwindow mode.

2009-01-07 Thread Jon TURNEY
From: Colin Harrison colin.harri...@virgin.net

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.tur...@dronecode.org.uk
---
 hw/xwin/winmultiwindowwndproc.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 3104a85..8d8a906 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -679,6 +679,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:  
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 04/13] Xming: Correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created.

2009-01-07 Thread Jon TURNEY
From: Colin Harrison colin.harri...@virgin.net

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.tur...@dronecode.org.uk
---
 hw/xwin/winmultiwindowwindow.c  |   15 ++-
 hw/xwin/winmultiwindowwndproc.c |8 
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 6cad631..2399d5a 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
@@ -483,6 +485,7 @@ winCreateWindowsWindow (WindowPtr pWin)
   int  iWidth;
   int  iHeight;
   HWND hWnd;
+  HWND hFore = NULL;
   WNDCLASSEX   wc;
   winWindowPriv(pWin);
   HICONhIcon;
@@ -493,6 +496,7 @@ winCreateWindowsWindow (WindowPtr pWin)
   static int   s_iWindowID = 0;
   winPrivScreenPtr pScreenPriv = pWinPriv-pScreenPriv;
   WinXSizeHints hints;
+  WindowPtrpDaddy;
 
 #if CYGMULTIWINDOW_DEBUG
   ErrorF (winCreateWindowsWindow - pWin: %08x\n, pWin);
@@ -567,6 +571,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 */
@@ -578,7 +591,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 8eadf45..3fc3cce 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
@@ -655,6 +657,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 */
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 11/13] Xming: Ensure we dont try to print a null value when displaying xkb configuration

2009-01-07 Thread Jon TURNEY
From: Colin Harrison colin.harri...@virgin.net

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 hw/xwin/winkeybd.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

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, 
-- 
1.6.0.4

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: xserver: Branch 'master'

2009-01-07 Thread Colin Guthrie
'Twas brillig, and Paulo César Pereira de Andrade at 07/01/09 16:55 did 
gyre and gimble:
 Daniel Stone wrote:
 On Mon, Jan 05, 2009 at 11:25:11AM -0800, Paulo Cesar Pereira de Andrade
 wrote:
 -extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
 +extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
 ?!?
 
   The XaceHook() function must be exported, or at least extmod
 will fail due to it being an unresolved symbol.

I wont pretend to know anything about this (you know me well enough on 
that from Paulo :)) but the  about diff applies _X_EXPORT to an array of 
CallbackListPtrs, not the XsceHook() function itself. If this is 
intended and I'm just not following just ignore me... ignorance is bliss :p

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[PATCH 1/5] dix: re-implement enter/leave model.

2009-01-07 Thread Peter Hutterer
The old model was implemented based on a misunderstanding of NotifyVirtual and
NotifyNonlinearVirtual events. It became complicated and was broken in some
places [1]. This patch wipes this model completely.

A much simplified implementation is provided instead. Rather than a top-down
approach (we have a tree of windows, which ones need to get which event)
this one uses a step-by-step approach. For each window W between A and B
determine the pointer window P as perceived by this window and determine the
event type based on this information. This is in-line with the model described
by Owen Taylor [2].

[1] http://lists.freedesktop.org/archives/xorg/2008-December/041559.html
[2] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html
---
 dix/enterleave.c |  596 +-
 1 files changed, 317 insertions(+), 279 deletions(-)

diff --git a/dix/enterleave.c b/dix/enterleave.c
index 8176f96..df915f5 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -39,74 +39,21 @@
  * to a core client without confusing it, this is a rather complicated
  * approach.
  *
- * For a full description of the model from a window's perspective, see
+ * For a full description of the enter/leave model from a window's
+ * perspective, see
  * http://lists.freedesktop.org/archives/xorg/2008-August/037606.html
  *
+ * Additional notes:
+ * -) The core protocol spec says that In a LeaveNotify event, if a child of 
the
+ * event window contains the initial position of the pointer, then the child
+ * component is set to that child. Otherwise, it is None.  For an EnterNotify
+ * event, if a child of the event window contains the final pointer position,
+ * then the child component is set to that child. Otherwise, it is None.
  *
- * EnterNotify(Virtual, B) means EnterNotify Event, detail Virtual, child = B.
- *
- * Pointer moves from A to B, nonlinear (CoreEnterLeaveNonLinear):
- * 1. a. if A has another pointer, goto 2.
- *b. otherwise, if A has a child with a pointer in it,
- *   LeaveNotify(Inferior) to A
- *   LeaveNotify(Virtual) between A and child(A)
- *
- * 2. Find common ancestor X between A and B.
- * 3. Find closest pointer window P between A and X.
- *a. if P exists
- *   LeaveNotify(Ancestor) to A
- *   LeaveNotify(Virtual) between A and P
- *b. otherwise, if P does not exist,
- *   LeaveNotify(NonLinear) to A
- *   LeaveNotify(NonLinearVirtual) between A and X.
- *
- * 4. If X does not have a pointer, EnterNotify(NonLinearVirtual, B) to X.
- * 5. Find closest pointer window P between X and B.
- *a. if P exists, EnterNotify(NonLinearVirtual) between X and P
- *b. otherwise, EnterNotify(NonLinearVirtual) between X and B
- *
- * 5. a. if B has another pointer in it, finish.
- *b. otherwise, if B has a child with a pointer in it
- *   LeaveNotify(Virtual) between child(B) and B.
- *   EnterNotify(Inferior) to B.
- *c. otherwise, EnterNotify(NonLinear) to B.
- *
- * --
- *
- * Pointer moves from A to B, A is a parent of B (CoreEnterLeaveToDescendant):
- * 1. a. If A has another pointer, goto 2.
- *b. Otherwise, LeaveNotify(Inferior) to A.
- *
- * 2. Find highest window X that has a pointer child that is not a child of B.
- *a. if X exists, EnterNotify(Virtual, B) between A and X,
- *   EnterNotify(Virtual, B) to X (if X has no pointer).
- *b. otherwise, EnterNotify(Virtual, B) between A and B.
- *
- * 3. a. if B has another pointer, finish
- *b. otherwise, if B has a child with a pointer in it,
- *   LeaveNotify(Virtual, child(B)) between child(B) and B.
- *   EnterNotify(Inferior, child(B)) to B.
- *c. otherwise, EnterNotify(Ancestor) to B.
- *
- * --
- *
- * Pointer moves from A to B, A is a child of B (CoreEnterLeaveToAncestor):
- * 1. a. If A has another pointer, goto 2.
- *b. Otherwise, if A has a child with a pointer in it.
- *   LeaveNotify(Inferior, child(A)) to A.
- *   EnterNotify(Virtual, child(A)) between A and child(A).
- *   Skip to 3.
- *
- * 2. Find closest pointer window P between A and B.
- *If P does not exist, P is B.
- *   LeaveNotify(Ancestor) to A.
- *   LeaveNotify(Virtual, A) between A and P.
- * 3. a. If B has another pointer, finish.
- *b. otherwise, EnterNotify(Inferior) to B.
+ * By inference, this means that only NotifyVirtual or NotifyNonlinearVirtual
+ * events may have a subwindow set to other than None.
  */
 
-#define WID(w) ((w) ? ((w)-drawable.id) : 0)
-
 /**
  * Return TRUE if @win has a pointer within its boundaries, excluding child
  * window.
@@ -123,109 +70,6 @@ HasPointer(WindowPtr win)
 return FALSE;
 }
 
-static BOOL
-HasOtherPointer(WindowPtr win, DeviceIntPtr dev)
-{
-int i;
-
-for (i = 0; i  sizeof(win-enterleave); i++)
-if 

[PATCH 3/5] dix: reduce FirstPointerChild complexity

2009-01-07 Thread Peter Hutterer
Instead of keeping a flag on each window for the devices that are in this
window, keep a local array that holds the current pointer window for each
device. Benefit: searching for the first descendant of a pointer is a simple
run through the array.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 dix/enterleave.c|   64 ---
 dix/window.c|1 -
 include/windowstr.h |1 -
 3 files changed, 10 insertions(+), 56 deletions(-)

diff --git a/dix/enterleave.c b/dix/enterleave.c
index fbe7af4..0b15619 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -54,6 +54,8 @@
  * events may have a subwindow set to other than None.
  */
 
+static WindowPtr PointerWindows[MAXDEVICES];
+
 /**
  * Return TRUE if @win has a pointer within its boundaries, excluding child
  * window.
@@ -63,8 +65,8 @@ HasPointer(WindowPtr win)
 {
 int i;
 
-for (i = 0; i  sizeof(win-enterleave); i++)
-if (win-enterleave[i])
+for (i = 0; i  MAXDEVICES; i++)
+if (PointerWindows[i] == win)
 return TRUE;
 
 return FALSE;
@@ -80,57 +82,11 @@ HasPointer(WindowPtr win)
 static WindowPtr
 FirstPointerChild(WindowPtr win)
 {
-static WindowPtr *queue = NULL;
-static int queue_size  = 256; /* allocated size of queue */
-
-WindowPtr child = NULL;
-int queue_len   = 0;  /* no of elements in queue */
-int queue_head  = 0;  /* pos of current element  */
-
-if (!win || !win-firstChild)
-return NULL;
-
-if (!queue  !(queue = xcalloc(queue_size, sizeof(WindowPtr
-FatalError([dix] FirstPointerChild: OOM.\n);
-
-queue[0] = win;
-queue_head = 0;
-queue_len  = 1;
-
-while (queue_len--)
+int i;
+for (i = 0; i  MAXDEVICES; i++)
 {
-if (queue[queue_head] != win  HasPointer(queue[queue_head]))
-return queue[queue_head];
-
-child = queue[queue_head]-firstChild;
-/* pop children onto queue */
-while(child)
-{
-queue_len++;
-if (queue_len = queue_size)
-{
-const int inc = 256;
-
-queue = xrealloc(queue, (queue_size + inc) * 
sizeof(WindowPtr));
-if (!queue)
-FatalError([dix] FirstPointerChild: OOM.\n);
-
-/* Are we wrapped around? */
-if (queue_head + queue_len  queue_size)
-{
-memmove(queue[queue_head + inc], queue[queue_head],
-(queue_size - queue_head) * sizeof(WindowPtr));
-queue_head += inc;
-}
-
-queue_size += inc;
-}
-
-queue[(queue_head + queue_len) % queue_size] = child;
-child = child-nextSib;
-}
-
-queue_head = (queue_head + 1) % queue_size;
+if (PointerWindows[i]  IsParent(win, PointerWindows[i]))
+return PointerWindows[i];
 }
 
 return NULL;
@@ -143,7 +99,7 @@ FirstPointerChild(WindowPtr win)
 void
 EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode)
 {
-win-enterleave[dev-id/8] |= (1  (dev-id % 8));
+PointerWindows[dev-id] = win;
 }
 
 /**
@@ -152,7 +108,7 @@ EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode)
 static void
 LeaveWindow(DeviceIntPtr dev, WindowPtr win, int mode)
 {
-win-enterleave[dev-id/8] = ~(1  (dev-id % 8));
+PointerWindows[dev-id] = NULL;
 }
 
 
diff --git a/dix/window.c b/dix/window.c
index 88ab5e9..ca07c96 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -300,7 +300,6 @@ SetWindowToDefaults(WindowPtr pWin)
 pWin-redirectDraw = RedirectDrawNone;
 pWin-forcedBG = FALSE;
 
-memset(pWin-enterleave, 0, sizeof(pWin-enterleave));
 memset(pWin-focusinout, 0, sizeof(pWin-focusinout));
 
 #ifdef ROOTLESS
diff --git a/include/windowstr.h b/include/windowstr.h
index b39b351..9f86e2c 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -183,7 +183,6 @@ typedef struct _Window {
  * FocusIn/Out events for multiple pointers/keyboards. Each device ID
  * corresponds to one bit. If set, the device is in the window/has focus.
  */
-charenterleave[(MAXDEVICES + 7)/8];
 charfocusinout[(MAXDEVICES + 7)/8];
 } WindowRec;
 
-- 
1.6.0.6

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 5/5] dix: move focus handling into enterleave.c.

2009-01-07 Thread Peter Hutterer
This commit moves the focus handling from events.c into enterleave.c and
implements a model similar to the core enter/leave model.
For a full description of the model, see:
http://lists.freedesktop.org/archives/xorg/2008-December/041740.html

This commit also gets rid of the focusinout array in the WindowRec, ditching
it in favour of a local array that keeps the current focus window for each
device.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 dix/enterleave.c|  800 ++-
 dix/enterleave.h|   25 ++
 dix/events.c|  284 ++-
 dix/window.c|2 -
 include/input.h |2 -
 include/windowstr.h |5 -
 6 files changed, 837 insertions(+), 281 deletions(-)

diff --git a/dix/enterleave.c b/dix/enterleave.c
index d01597a..1a5f1b5 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -30,19 +30,24 @@
 
 #include X11/X.h
 #include windowstr.h
+#include scrnintstr.h
 #include exglobals.h
 #include enterleave.h
 
-/* @file This file describes the model for sending core enter/leave events in
- * the case of multiple pointers.
- * Since we can't send more than one Enter or Leave event per window
- * to a core client without confusing it, this is a rather complicated
+/* @file This file describes the model for sending core enter/leave events and
+ * focus in/out in the case of multiple pointers/keyboard foci
+ * Since we can't send more than one Enter or Leave/Focus in or out event per
+ * window to a core client without confusing it, this is a rather complicated
  * approach.
  *
  * For a full description of the enter/leave model from a window's
  * perspective, see
  * http://lists.freedesktop.org/archives/xorg/2008-August/037606.html
  *
+ * For a full description of the focus in/out model from a window's
+ * perspective, see
+ * http://lists.freedesktop.org/archives/xorg/2008-December/041740.html
+ *
  * Additional notes:
  * -) The core protocol spec says that In a LeaveNotify event, if a child of 
the
  * event window contains the initial position of the pointer, then the child
@@ -52,6 +57,12 @@
  *
  * By inference, this means that only NotifyVirtual or NotifyNonlinearVirtual
  * events may have a subwindow set to other than None.
+ *
+ * -) NotifyPointer events may be sent if the focus changes from window A to
+ * B. The assumption used in this model is that NotifyPointer events are only
+ * sent for the pointer paired with the keyboard that is involved in the focus
+ * events. For example, if F(W) changes because of keyboard 2, then
+ * NotifyPointer events are only sent for pointer 2.
  */
 
 static WindowPtr PointerWindows[MAXDEVICES];
@@ -73,6 +84,10 @@ HasPointer(WindowPtr win)
 return FALSE;
 }
 
+/**
+ * Return TRUE if at least one keyboard focus is set to @win (excluding
+ * descendants of win).
+ */
 static BOOL
 HasFocus(WindowPtr win)
 {
@@ -85,6 +100,15 @@ HasFocus(WindowPtr win)
 }
 
 /**
+ * Return the window the device @dev is currently on.
+ */
+static WindowPtr
+PointerWin(DeviceIntPtr dev)
+{
+return PointerWindows[dev-id];
+}
+
+/**
  * Search for the first window below @win that has a pointer directly within
  * it's boundaries (excluding boundaries of its own descendants).
  *
@@ -105,7 +129,7 @@ FirstPointerChild(WindowPtr win)
 }
 
 /**
- * Search for the first window below @win that has a pointer directly within
+ * Search for the first window below @win that has a focus directly within
  * it's boundaries (excluding boundaries of its own descendants).
  *
  * @return The child window that has the pointer within its boundaries or
@@ -125,8 +149,6 @@ FirstFocusChild(WindowPtr win)
 return NULL;
 }
 
-
-
 /**
  * Set the presence flag for @dev to mark that it is now in @win.
  */
@@ -581,3 +603,767 @@ DoEnterLeaveEvents(DeviceIntPtr pDev,
 CoreEnterLeaveEvents(pDev, fromWin, toWin, mode);
 DeviceEnterLeaveEvents(pDev, fromWin, toWin, mode);
 }
+
+/**
+ * Send focus out events to all windows between @child and @ancestor.
+ * Events are sent running up the hierarchy.
+ */
+static void
+DeviceFocusOutEvents(DeviceIntPtr dev,
+ WindowPtr child,
+ WindowPtr ancestor,
+ int mode,
+ int detail)
+{
+WindowPtr  win;
+
+if (ancestor == child)
+   return;
+for (win = child-parent; win != ancestor; win = win-parent)
+DeviceFocusEvent(dev, DeviceFocusOut, mode, detail, win);
+}
+
+
+/**
+ * Send enter notifies to all windows between @ancestor and @child (excluding
+ * both). Events are sent running up the window hierarchy. This function
+ * recurses.
+ */
+static void
+DeviceFocusInEvents(DeviceIntPtr dev,
+WindowPtr ancestor,
+WindowPtr child,
+int mode,
+int detail)
+{
+WindowPtr  parent = child-parent;
+
+if (ancestor == parent || !parent)
+   return;
+

SCaLE Promo Code for XORG

2009-01-07 Thread Joe Smith
Hey guys,

The Southern California Linux Expo, a community run conference taking
place in Los Angeles on February 20th to 22nd, is offering a 50% discount
to the XORG community. When you go to register[1], just enter the promo
code: XRG09. If you have any questions, please let me know.

Thanks!
Joe Smith
Southern California Linux Expo

[1] https://socallinuxexpo.org/reg7/
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: xserver: Branch 'master'

2009-01-07 Thread Eamon Walsh
Colin Guthrie wrote:
 'Twas brillig, and Paulo César Pereira de Andrade at 07/01/09 16:55 did 
 gyre and gimble:
   
 Daniel Stone wrote:
 
 On Mon, Jan 05, 2009 at 11:25:11AM -0800, Paulo Cesar Pereira de Andrade
 wrote:
   
 -extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
 +extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
 
 ?!?
   
   The XaceHook() function must be exported, or at least extmod
 will fail due to it being an unresolved symbol.
 

 I wont pretend to know anything about this (you know me well enough on 
 that from Paulo :)) but the  about diff applies _X_EXPORT to an array of 
 CallbackListPtrs, not the XsceHook() function itself. If this is 
 intended and I'm just not following just ignore me... ignorance is bliss :p

 Col

   


XaceHooks is exported so that modules can register / unregister
callbacks.  Is the export of this variable a problem?

API could be added to wrap the registration and unregistration which
would allow XaceHooks to be a static variable.  It would be 2 new
exported functions though, versus the one variable.





-- 
Eamon Walsh ewa...@tycho.nsa.gov
National Security Agency

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: [PATCH 1/5] dix: re-implement enter/leave model.

2009-01-07 Thread Keith Packard
On Thu, 2009-01-08 at 10:13 +1000, Peter Hutterer wrote:
 The old model was implemented based on a misunderstanding of NotifyVirtual and
 NotifyNonlinearVirtual events. It became complicated and was broken in some
 places [1]. This patch wipes this model completely.

Independent of whether this has bugs remaining, this sequence looks like
the right approach to make this problem tractable. Please push this to
master and I'll work on pulling it into the 1.6 branch, reviewing it as
best I can in the process of doing that.

-- 
keith.pack...@intel.com


signature.asc
Description: This is a digitally signed message part
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[PATCH] mi: ensure chained button mappings from SD - MD (#19282)

2009-01-07 Thread Peter Hutterer
After copying the master event, flip the detail field to the mapped button of
the SD, not the physical button. This way if the SD has a mapping 1:3 and the
MD has a mapping of 3:4, a press on button 1 on the SD results in a core event
on button 4.

X.Org Bug 19282 http://bugs.freedesktop.org/show_bug.cgi?id=19282

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 mi/mieq.c   |   26 --
 xkb/ddxDevBtn.c |2 +-
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/mi/mieq.c b/mi/mieq.c
index 82bbb2c..e1f647d 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -277,15 +277,32 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
 DebugF([mi] Unknown event type (%d), cannot change id.\n, type);
 }
 
+static void
+FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original,
+EventListPtr master, int count)
+{
+/* Ensure chained button mappings, i.e. that the detail field is the
+ * value of the mapped button on the SD, not the physical button */
+if (original-u.u.type == DeviceButtonPress || original-u.u.type == 
DeviceButtonRelease)
+{
+int btn = original-u.u.detail;
+if (!sdev-button)
+return; /* Should never happen */
+
+master-event-u.u.detail = sdev-button-map[btn];
+}
+}
+
 /**
  * Copy the given event into master.
  * @param mdev The master device
+ * @param sdev The slave device the original event comes from
  * @param original The event as it came from the EQ
  * @param master The event after being copied
  * @param count Number of events in original.
  */
 void
-CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
+CopyGetMasterEvent(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original,
EventListPtr master, int count)
 {
 int len = count * sizeof(xEvent);
@@ -300,9 +317,14 @@ CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
 
 memcpy(master-event, original, len);
 while (count--)
+{
 ChangeDeviceID(mdev, master-event[count]);
+FixUpEventForMaster(mdev, sdev, original, master, count);
+}
 }
 
+
+
 /* Call this from ProcessInputEvents(). */
 void
 mieqProcessInputEvents(void)
@@ -365,7 +387,7 @@ mieqProcessInputEvents(void)
 }
 else {
 if (master)
-CopyGetMasterEvent(master, event, masterEvents, nevents);
+CopyGetMasterEvent(master, dev, event, masterEvents, nevents);
 
 /* If someone's registered a custom event handler, let them
  * steal it. */
diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c
index 709efc1..03fb440 100644
--- a/xkb/ddxDevBtn.c
+++ b/xkb/ddxDevBtn.c
@@ -116,7 +116,7 @@ DeviceIntPtrmaster = NULL;
 if (!IsPointerDevice(master))
 master = GetPairedDevice(dev-u.master);
 
-CopyGetMasterEvent(master, events, masterEvents, count);
+CopyGetMasterEvent(master, dev, events, masterEvents, count);
 }
 
 (*dev-public.processInputProc)((xEventPtr)btn, dev, count);
-- 
1.6.0.6
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: [PATCH] mi: ensure chained button mappings from SD - MD (#19282)

2009-01-07 Thread Thomas Jaeger
Alexia: What is the point of remapping buttons willy-nilly before
posting an event anyway?  The comment suggests it just servers as a
reminder of how remapping works.  It's problematic in that proper
DeviceMappingNotify events aren't send and I don't want to think about
what could potentially happen if some client calls XTestFakeButtonEvent
(let alone XTestFakeDeviceButtonEvent) at the right moment.  The problem
in bug #19282 was fixed in ubuntu by simply skipping the remapping step,
and I'm not aware of any issues that this may have caused.

Peter Hutterer wrote:
 After copying the master event, flip the detail field to the mapped button of
 the SD, not the physical button. This way if the SD has a mapping 1:3 and the
 MD has a mapping of 3:4, a press on button 1 on the SD results in a core event
 on button 4.
 
 X.Org Bug 19282 http://bugs.freedesktop.org/show_bug.cgi?id=19282
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  mi/mieq.c   |   26 --
  xkb/ddxDevBtn.c |2 +-
  2 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/mi/mieq.c b/mi/mieq.c
 index 82bbb2c..e1f647d 100644
 --- a/mi/mieq.c
 +++ b/mi/mieq.c
 @@ -277,15 +277,32 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
  DebugF([mi] Unknown event type (%d), cannot change id.\n, type);
  }
  
 +static void
 +FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original,
 +EventListPtr master, int count)
 +{
 +/* Ensure chained button mappings, i.e. that the detail field is the
 + * value of the mapped button on the SD, not the physical button */
 +if (original-u.u.type == DeviceButtonPress || original-u.u.type == 
 DeviceButtonRelease)
 +{
 +int btn = original-u.u.detail;
 +if (!sdev-button)
 +return; /* Should never happen */
 +
 +master-event-u.u.detail = sdev-button-map[btn];

Shouldn't this be master-event[count].u.u.detail... ?
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[RFC][PATCH] xf86-input-evdev: add pressure valuator

2009-01-07 Thread Matt Helsley
If it available report pressure as the third valuator.

Signed-off-by: Matt Helsley matt.hels...@gmail.com
---
I couldn't seem to get the third valuator from X with
xf86-input-evdev master when I was testing this over the
holidays. (tested using the GIMP)

So I backported to an older version of evdev available in
my distro (Ubuntu 8.10) and it tested successfully there.

What am I missing here?

 src/evdev.c |   62 ++--
 src/evdev.h |6 +++--
 2 files changed, 60 insertions(+), 8 deletions(-)

Index: xf86-input-evdev/src/evdev.h
===
--- xf86-input-evdev.orig/src/evdev.h
+++ xf86-input-evdev/src/evdev.h
@@ -58,19 +58,21 @@ typedef struct {
 
 typedef struct {
 const char *device;
 int grabDevice; /* grab the event device? */
 int screen;
-int min_x, min_y, max_x, max_y;
-int abs_x, abs_y, old_x, old_y;
+int min_x, min_y, max_x, max_y, min_p, max_p;
+int abs_x, abs_y, abs_p, old_x, old_y;
 int flags;
 int tool;
 int buttons;/* number of buttons */
 BOOL swap_axes;
 BOOL invert_x;
 BOOL invert_y;
 
+BOOL pressure_valuator;
+
 /* XKB stuff has to be per-device rather than per-driver */
 int noXkb;
 #ifdef XKB
 char*xkb_rules;
 char*xkb_model;
Index: xf86-input-evdev/src/evdev.c
===
--- xf86-input-evdev.orig/src/evdev.c
+++ xf86-input-evdev/src/evdev.c
@@ -384,10 +384,14 @@ EvdevReadInput(InputInfoPtr pInfo)
break;
case ABS_Y:
pEvdev-abs_y = value;
abs = 1;
break;
+   case ABS_PRESSURE:
+   pEvdev-abs_p = value;
+   abs = 1;
+   break;
}
break;
 
 case EV_KEY:
/* don't repeat mouse buttons */
@@ -475,11 +479,11 @@ EvdevReadInput(InputInfoPtr pInfo)
  * pEvdev-digi here, lets us ignore that event.  pEvdev is
  * initialized to 1 so devices that doesn't use this scheme still
  * just works.
  */
 if (abs  pEvdev-tool) {
-int abs_x, abs_y;
+int abs_x, abs_y, abs_p;
 abs_x = (pEvdev-swap_axes) ? pEvdev-abs_y : pEvdev-abs_x;
 abs_y = (pEvdev-swap_axes) ? pEvdev-abs_x : pEvdev-abs_y;
 
 if (pEvdev-flags  EVDEV_CALIBRATED)
 {
@@ -488,17 +492,23 @@ EvdevReadInput(InputInfoPtr pInfo)
 pEvdev-calibration.max_x, pEvdev-calibration.min_x);
 abs_y = xf86ScaleAxis(abs_y,
 pEvdev-max_y, pEvdev-min_y,
 pEvdev-calibration.max_y, pEvdev-calibration.min_y);
 }
+   abs_p = pEvdev-abs_p;
 
 if (pEvdev-invert_x)
 abs_x = pEvdev-max_x - (abs_x - pEvdev-min_x);
 if (pEvdev-invert_y)
 abs_y = pEvdev-max_y - (abs_y - pEvdev-min_y);
 
-   xf86PostMotionEvent(pInfo-dev, TRUE, 0, 2, abs_x, abs_y);
+   if (pEvdev-pressure_valuator)
+   xf86PostMotionEvent(pInfo-dev, TRUE, 0, 3,
+   abs_x, abs_y, abs_p);
+   else
+   xf86PostMotionEvent(pInfo-dev, TRUE, 0, 2,
+   abs_x, abs_y);
 }
 }
 
 #define TestBit(bit, array) (array[(bit) / LONG_BITS])  (1L  ((bit) % 
LONG_BITS))
 
@@ -878,11 +888,12 @@ EvdevAddKeyClass(DeviceIntPtr device)
 static int
 EvdevAddAbsClass(DeviceIntPtr device)
 {
 InputInfoPtr pInfo;
 EvdevPtr pEvdev;
-struct input_absinfo absinfo_x, absinfo_y;
+struct input_absinfo absinfo_x, absinfo_y, absinfo_p;
+int num_valuators = 2;
 
 pInfo = device-public.devicePrivate;
 pEvdev = pInfo-private;
 
 if (ioctl(pInfo-fd,
@@ -900,11 +911,24 @@ EvdevAddAbsClass(DeviceIntPtr device)
 pEvdev-min_x = absinfo_x.minimum;
 pEvdev-max_x = absinfo_x.maximum;
 pEvdev-min_y = absinfo_y.minimum;
 pEvdev-max_y = absinfo_y.maximum;
 
-if (!InitValuatorClassDeviceStruct(device, 2,
+if (pEvdev-pressure_valuator  ioctl(pInfo-fd,
+ EVIOCGABS(ABS_PRESSURE), absinfo_p)  0) {
+   xf86Msg(X_ERROR, ioctl EVIOCGABS ABS_PRESSURE failed: %s\n, 
strerror(errno));
+   return !Success;
+}
+
+if (pEvdev-pressure_valuator) {
+   num_valuators++;
+   pEvdev-max_p = absinfo_p.maximum;
+   pEvdev-min_p = absinfo_p.minimum;
+}
+
+
+if (!InitValuatorClassDeviceStruct(device, num_valuators,
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION)  3
GetMotionHistory,
 #endif
GetMotionHistorySize(), Absolute))
 return !Success;
@@ -916,10 +940,17 @@ EvdevAddAbsClass(DeviceIntPtr device)
 
 /* Y valuator */
 xf86InitValuatorAxisStruct(device, 1, pEvdev-min_y, pEvdev-max_y,
   1, 0,