Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Adam Jackson
xserver
Commits
387563b7
Commit
387563b7
authored
Nov 23, 2008
by
Matthieu Herrb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git+ssh://herrb@git.freedesktop.org/git/xorg/xserver
parents
85f650c9
f6e01fa1
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
251 additions
and
60 deletions
+251
-60
configure.ac
configure.ac
+1
-0
hw/xfree86/common/Makefile.am
hw/xfree86/common/Makefile.am
+1
-1
hw/xfree86/common/xf86.h
hw/xfree86/common/xf86.h
+1
-0
hw/xfree86/common/xf86Globals.c
hw/xfree86/common/xf86Globals.c
+1
-0
hw/xfree86/common/xf86Init.c
hw/xfree86/common/xf86Init.c
+14
-1
hw/xfree86/common/xf86Priv.h
hw/xfree86/common/xf86Priv.h
+1
-0
hw/xfree86/common/xf86ShowOpts.c
hw/xfree86/common/xf86ShowOpts.c
+129
-0
hw/xquartz/GL/indirect.c
hw/xquartz/GL/indirect.c
+63
-29
hw/xquartz/Makefile.am
hw/xquartz/Makefile.am
+2
-2
hw/xquartz/darwin.c
hw/xquartz/darwin.c
+5
-7
hw/xquartz/darwinEvents.c
hw/xquartz/darwinEvents.c
+5
-5
hw/xquartz/quartzKeyboard.c
hw/xquartz/quartzKeyboard.c
+4
-3
hw/xquartz/quartzPasteboard.c
hw/xquartz/quartzPasteboard.c
+1
-1
hw/xquartz/xpr/xprCursor.c
hw/xquartz/xpr/xprCursor.c
+23
-11
No files found.
configure.ac
View file @
387563b7
...
...
@@ -1878,6 +1878,7 @@ hw/vfb/Makefile
hw/xnest/Makefile
hw/xwin/Makefile
hw/xquartz/Makefile
hw/xquartz/GL/Makefile
hw/xquartz/bundle/Makefile
hw/xquartz/doc/Makefile
hw/xquartz/mach-startup/Makefile
...
...
hw/xfree86/common/Makefile.am
View file @
387563b7
...
...
@@ -25,7 +25,7 @@ xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
BUILT_SOURCES
=
xf86DefModeSet.c
AM_LDFLAGS
=
-r
libcommon_la_SOURCES
=
xf86Configure.c xf86Bus.c xf86Config.c
\
libcommon_la_SOURCES
=
xf86Configure.c
xf86ShowOpts.c
xf86Bus.c xf86Config.c
\
xf86Cursor.c xf86DGA.c xf86DPMS.c
\
xf86DoProbe.c xf86Events.c
\
xf86Globals.c xf86AutoConfig.c
\
...
...
hw/xfree86/common/xf86.h
View file @
387563b7
...
...
@@ -56,6 +56,7 @@
/* General parameters */
extern
int
xf86DoConfigure
;
extern
int
xf86DoShowOptions
;
extern
Bool
xf86DoModalias
;
extern
Bool
xf86DoConfigurePass1
;
extern
DevPrivateKey
xf86ScreenKey
;
...
...
hw/xfree86/common/xf86Globals.c
View file @
387563b7
...
...
@@ -153,6 +153,7 @@ Bool xf86Resetting = FALSE;
Bool
xf86Initialising
=
FALSE
;
Bool
xf86DoProbe
=
FALSE
;
Bool
xf86DoConfigure
=
FALSE
;
Bool
xf86DoShowOptions
=
FALSE
;
Bool
xf86DoModalias
=
FALSE
;
DriverPtr
*
xf86DriverList
=
NULL
;
int
xf86NumDrivers
=
0
;
...
...
hw/xfree86/common/xf86Init.c
View file @
387563b7
...
...
@@ -688,7 +688,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
}
/* Read and parse the config file */
if
(
!
xf86DoProbe
&&
!
xf86DoConfigure
&&
!
xf86DoModalias
)
{
if
(
!
xf86DoProbe
&&
!
xf86DoConfigure
&&
!
xf86DoModalias
&&
!
xf86DoShowOptions
)
{
switch
(
xf86HandleConfigFile
(
FALSE
))
{
case
CONFIG_OK
:
break
;
...
...
@@ -713,6 +713,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
LoaderSetOptions
(
LDR_OPT_ABI_MISMATCH_NONFATAL
);
}
if
(
xf86DoShowOptions
)
DoShowOptions
();
xf86OpenConsole
();
/* Do a general bus probe. This will be a PCI probe for x86 platforms */
...
...
@@ -1774,6 +1777,15 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86AllowMouseOpenFail
=
TRUE
;
return
1
;
}
if
(
!
strcmp
(
argv
[
i
],
"-showopts"
))
{
if
(
getuid
()
!=
0
&&
geteuid
()
==
0
)
{
ErrorF
(
"The '-showopts' option can only be used by root.
\n
"
);
exit
(
1
);
}
xf86DoShowOptions
=
TRUE
;
return
1
;
}
if
(
!
strcmp
(
argv
[
i
],
"-isolateDevice"
))
{
int
bus
,
device
,
func
;
...
...
@@ -1812,6 +1824,7 @@ ddxUseMsg()
ErrorF
(
"-modulepath paths specify the module search path
\n
"
);
ErrorF
(
"-logfile file specify a log file name
\n
"
);
ErrorF
(
"-configure probe for devices and write an "
__XCONFIGFILE__
"
\n
"
);
ErrorF
(
"-showopts print available options for all installed drivers
\n
"
);
}
ErrorF
(
"-modalias output a modalias-style filter for each driver installed
\n
"
);
ErrorF
(
"-config file specify a configuration file, relative to the
\n
"
);
...
...
hw/xfree86/common/xf86Priv.h
View file @
387563b7
...
...
@@ -153,6 +153,7 @@ extern const int xf86NumDefaultModes;
/* xf86DoProbe.c */
void
DoProbe
(
void
);
void
DoConfigure
(
void
);
void
DoShowOptions
(
void
);
/* xf86Events.c */
...
...
hw/xfree86/common/xf86ShowOpts.c
0 → 100644
View file @
387563b7
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86ShopwOpts.c,v 3.80 2003/10/08 14:58:27 dawes Exp $ */
/*
* Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Alan Hourihane not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Alan Hourihane makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Author: Marcus Schaefer, ms@suse.de
*
*/
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <X11/X.h>
#include <X11/Xmd.h>
#include "os.h"
#ifdef XFree86LOADER
#include "loaderProcs.h"
#endif
#include "xf86.h"
#include "xf86Config.h"
#include "xf86_OSlib.h"
#include "xf86Priv.h"
/* #include "xf86PciData.h" */
#define IN_XSERVER
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "Configint.h"
#include "vbe.h"
#include "xf86DDC.h"
#if defined(__sparc__) && !defined(__OpenBSD__)
#include "xf86Bus.h"
#include "xf86Sbus.h"
#endif
#include "globals.h"
static
const
char
*
optionTypeToSting
(
OptionValueType
type
)
{
switch
(
type
)
{
case
OPTV_NONE
:
return
""
;
case
OPTV_INTEGER
:
return
"<int>"
;
case
OPTV_STRING
:
return
"<str>"
;
case
OPTV_ANYSTR
:
return
"<str>"
;
case
OPTV_REAL
:
return
"<real>"
;
case
OPTV_BOOLEAN
:
return
"<bool>"
;
case
OPTV_FREQ
:
return
"<freq>"
;
default:
return
"<undef>"
;
}
}
void
DoShowOptions
(
void
)
{
int
i
=
0
;
char
**
vlist
=
0
;
char
*
pSymbol
=
0
;
XF86ModuleData
*
initData
=
0
;
if
(
!
(
vlist
=
xf86DriverlistFromCompile
()))
{
ErrorF
(
"Missing output drivers
\n
"
);
goto
bail
;
}
xf86LoadModules
(
vlist
,
0
);
xfree
(
vlist
);
for
(
i
=
0
;
i
<
xf86NumDrivers
;
i
++
)
{
if
(
xf86DriverList
[
i
]
->
AvailableOptions
)
{
OptionInfoPtr
pOption
=
(
OptionInfoPtr
)(
*
xf86DriverList
[
i
]
->
AvailableOptions
)(
0
,
0
);
if
(
!
pOption
)
{
ErrorF
(
"(EE) Couldn't read option table for %s driver
\n
"
,
xf86DriverList
[
i
]
->
driverName
);
continue
;
}
pSymbol
=
xalloc
(
strlen
(
xf86DriverList
[
i
]
->
driverName
)
+
strlen
(
"ModuleData"
)
+
1
);
strcpy
(
pSymbol
,
xf86DriverList
[
i
]
->
driverName
);
strcat
(
pSymbol
,
"ModuleData"
);
initData
=
LoaderSymbol
(
pSymbol
);
if
(
initData
)
{
XF86ModuleVersionInfo
*
vers
=
initData
->
vers
;
ErrorF
(
"Driver[%d]:%s[%s] {
\n
"
,
i
,
xf86DriverList
[
i
]
->
driverName
,
vers
->
vendor
);
OptionInfoPtr
p
;
for
(
p
=
pOption
;
p
->
name
!=
NULL
;
p
++
)
{
const
char
*
opttype
=
optionTypeToSting
(
p
->
type
);
char
*
optname
=
xalloc
(
strlen
(
p
->
name
)
+
2
+
1
);
if
(
!
optname
)
{
continue
;
}
sprintf
(
optname
,
"%s"
,
p
->
name
);
ErrorF
(
"
\t
%s:%s
\n
"
,
optname
,
opttype
);
}
ErrorF
(
"}
\n
"
);
}
}
}
bail:
OsCleanup
(
TRUE
);
AbortDDX
();
fflush
(
stderr
);
exit
(
0
);
}
hw/xquartz/GL/indirect.c
View file @
387563b7
...
...
@@ -81,7 +81,6 @@
typedef
unsigned
long
long
GLuint64EXT
;
typedef
long
long
GLint64EXT
;
#include <Xplugin.h>
#include "glcontextmodes.h"
#include <glapi.h>
#include <glapitable.h>
...
...
@@ -156,7 +155,7 @@ struct __GLXAquaContext {
};
struct
__GLXAquaDrawable
{
__GLXdrawable
base
;
__GLXdrawable
base
;
DrawablePtr
pDraw
;
xp_surface_id
sid
;
};
...
...
@@ -298,49 +297,61 @@ static void surface_notify(void *_arg, void *data) {
}
}
static
void
attach
(
__GLXAquaContext
*
context
,
__GLXAquaDrawable
*
draw
)
{
static
BOOL
attach
(
__GLXAquaContext
*
context
,
__GLXAquaDrawable
*
draw
)
{
DrawablePtr
pDraw
;
GLAQUA_DEBUG_MSG
(
"attach(%p, %p)
\n
"
,
context
,
draw
);
GLAQUA_DEBUG_MSG
(
"attach(%p, %p)
\n
"
,
context
,
draw
);
if
(
NULL
==
context
||
NULL
==
draw
)
return
TRUE
;
pDraw
=
draw
->
base
.
pDraw
;
if
(
NULL
==
pDraw
)
{
ErrorF
(
"%s:attach() pDraw is NULL!
\n
"
,
__FILE__
);
return
TRUE
;
}
if
(
draw
->
sid
==
0
)
{
//
if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
//if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
if
(
!
DRICreateSurface
(
pDraw
->
pScreen
,
pDraw
->
id
,
pDraw
,
0
,
&
draw
->
sid
,
NULL
,
surface_notify
,
draw
))
return
;
0
,
&
draw
->
sid
,
NULL
,
surface_notify
,
draw
))
return
TRUE
;
draw
->
pDraw
=
pDraw
;
}
}
if
(
!
context
->
isAttached
||
context
->
sid
!=
draw
->
sid
)
{
x_list
*
lst
;
if
(
xp_attach_gl_context
(
context
->
ctx
,
draw
->
sid
)
!=
Success
)
{
//
quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
//
quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
DRIDestroySurface
(
pDraw
->
pScreen
,
pDraw
->
id
,
pDraw
,
surface_notify
,
draw
);
surface_notify
,
draw
);
if
(
surface_hash
!=
NULL
)
x_hash_table_remove
(
surface_hash
,
x_cvt_uint_to_vptr
(
draw
->
sid
));
draw
->
sid
=
0
;
return
;
return
TRUE
;
}
context
->
isAttached
=
TRUE
;
context
->
sid
=
draw
->
sid
;
if
(
surface_hash
==
NULL
)
surface_hash
=
x_hash_table_new
(
NULL
,
NULL
,
NULL
,
NULL
);
lst
=
x_hash_table_lookup
(
surface_hash
,
x_cvt_uint_to_vptr
(
context
->
sid
),
NULL
);
if
(
x_list_find
(
lst
,
context
)
==
NULL
)
{
lst
=
x_list_prepend
(
lst
,
context
);
x_hash_table_insert
(
surface_hash
,
x_cvt_uint_to_vptr
(
context
->
sid
),
lst
);
}
GLAQUA_DEBUG_MSG
(
"attached 0x%x to 0x%x
\n
"
,
(
unsigned
int
)
pDraw
->
id
,
(
unsigned
int
)
draw
->
sid
);
}
return
FALSE
;
}
#if 0 // unused
...
...
@@ -370,11 +381,12 @@ static void unattach(__GLXAquaContext *context) {
static
int
__glXAquaContextMakeCurrent
(
__GLXcontext
*
baseContext
)
{
CGLError
gl_err
;
__GLXAquaContext
*
context
=
(
__GLXAquaContext
*
)
baseContext
;
__GLXAquaDrawable
*
drawPriv
=
(
__GLXAquaDrawable
*
)
context
->
base
.
drawPriv
;
__GLXAquaDrawable
*
drawPriv
=
(
__GLXAquaDrawable
*
)
context
->
base
.
drawPriv
;
GLAQUA_DEBUG_MSG
(
"glAquaMakeCurrent (ctx 0x%p)
\n
"
,
baseContext
);
attach
(
context
,
drawPriv
);
if
(
attach
(
context
,
drawPriv
))
return
/*error*/
0
;
gl_err
=
CGLSetCurrentContext
(
context
->
ctx
);
if
(
gl_err
!=
0
)
...
...
@@ -1310,8 +1322,8 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
screen
->
base
.
fbconfigs
=
configs
;
screen
->
base
.
numFBConfigs
=
1
;
screen
->
base
.
visuals
=
configs
;
screen
->
base
.
numVisuals
=
1
;
screen
->
base
.
visuals
=
NULL
;
screen
->
base
.
numVisuals
=
0
;
GlxSetVisualConfig
(
GLX_ALL_VISUALS
);
...
...
@@ -1337,14 +1349,34 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
return
&
screen
->
base
;
}
static
void
__glXAquaDrawableCopySubBuffer
(
__GLXdrawable
*
drawable
,
int
x
,
int
y
,
int
w
,
int
h
)
{
/*TODO finish me*/
}
static
void
__glXAquaDrawableDestroy
(
__GLXdrawable
*
base
)
{
GLAQUA_DEBUG_MSG
(
"glAquaDestroyDrawablePrivate
\n
"
);
/* gstaplin: base is the head of the structure, so it's at the same
* offset in memory.
* Is this safe with strict aliasing? I noticed that the other dri code
* does this too...
*/
__GLXAquaDrawable
*
glxPriv
=
(
__GLXAquaDrawable
*
)
base
;
GLAQUA_DEBUG_MSG
(
__func__
);
/* It doesn't work to call DRIDestroySurface here, the drawable's
already gone.. But dri.c notices the window destruction and
frees the surface itself. */
free
(
base
);
/*gstaplin: verify the statement above. The surface destroy
*messages weren't making it through, and may still not be.
*We need a good test case for surface creation and destruction.
*We also need a good way to enable introspection on the server
*to validate the test, beyond using gdb with print.
*/
xfree
(
glxPriv
);
}
static
__GLXdrawable
*
...
...
@@ -1358,11 +1390,13 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
GLAQUA_DEBUG_MSG
(
"glAquaScreenCreateDrawable(%p,%p,%d,%p)
\n
"
,
context
,
pDraw
,
drawId
,
modes
);
glxPriv
=
xalloc
(
sizeof
*
glxPriv
);
if
(
glxPriv
==
NULL
)
return
NULL
;
if
(
glxPriv
==
NULL
)
return
NULL
;
memset
(
glxPriv
,
0
,
sizeof
*
glxPriv
);
if
(
!
__glXDrawableInit
(
&
glxPriv
->
base
,
screen
,
pDraw
,
type
,
drawId
,
conf
))
{
if
(
!
__glXDrawableInit
(
&
glxPriv
->
base
,
screen
,
pDraw
,
type
,
drawId
,
conf
))
{
xfree
(
glxPriv
);
return
NULL
;
}
...
...
@@ -1370,7 +1404,7 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
glxPriv
->
base
.
destroy
=
__glXAquaDrawableDestroy
;
glxPriv
->
base
.
resize
=
__glXAquaDrawableResize
;
glxPriv
->
base
.
swapBuffers
=
__glXAquaDrawableSwapBuffers
;
//
glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
glxPriv
->
base
.
copySubBuffer
=
__glXAquaDrawableCopySubBuffer
;
return
&
glxPriv
->
base
;
}
...
...
hw/xquartz/Makefile.am
View file @
387563b7
...
...
@@ -13,9 +13,9 @@ if GLX
GL_DIR
=
GL
endif
SUBDIRS
=
bundle
.
GL
xpr pbproxy mach-startup doc
SUBDIRS
=
bundle
.
$(GL_DIR)
xpr pbproxy mach-startup doc
DIST_SUBDIRS
=
bundle
.
$(GL_DIR)
xpr pbproxy mach-startup doc
DIST_SUBDIRS
=
bundle
.
GL
xpr pbproxy mach-startup doc
libXquartz_la_SOURCES
=
\
$(top_srcdir)
/fb/fbcmap_mi.c
\
...
...
hw/xquartz/darwin.c
View file @
387563b7
...
...
@@ -345,7 +345,6 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) {
// Set button map.
InitPointerDeviceStruct
((
DevicePtr
)
pPointer
,
map
,
7
,
GetMotionHistory
,
(
PtrCtrlProcPtr
)
NoopDDA
,
GetMotionHistorySize
(),
2
);
InitAbsoluteClassDeviceStruct
(
pPointer
);
...
...
@@ -376,7 +375,6 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
// Set button map.
InitPointerDeviceStruct
((
DevicePtr
)
pPointer
,
map
,
3
,
GetMotionHistory
,
(
PtrCtrlProcPtr
)
NoopDDA
,
GetMotionHistorySize
(),
5
);
pPointer
->
valuator
->
mode
=
Absolute
;
// Relative
...
...
@@ -477,7 +475,7 @@ int DarwinParseModifierList(const char *constmodifiers, int separatelr)
*/
void
InitInput
(
int
argc
,
char
**
argv
)
{
darwinKeyboard
=
AddInputDevice
(
DarwinKeybdProc
,
TRUE
);
darwinKeyboard
=
AddInputDevice
(
serverClient
,
DarwinKeybdProc
,
TRUE
);
RegisterKeyboardDevice
(
darwinKeyboard
);
darwinKeyboard
->
name
=
strdup
(
"keyboard"
);
...
...
@@ -495,19 +493,19 @@ void InitInput( int argc, char **argv )
gdkdev->info.source = GDK_SOURCE_PEN;
*/
darwinPointer
=
AddInputDevice
(
DarwinMouseProc
,
TRUE
);
darwinPointer
=
AddInputDevice
(
serverClient
,
DarwinMouseProc
,
TRUE
);
RegisterPointerDevice
(
darwinPointer
);
darwinPointer
->
name
=
strdup
(
"pointer"
);
darwinTabletStylus
=
AddInputDevice
(
DarwinTabletProc
,
TRUE
);
darwinTabletStylus
=
AddInputDevice
(
serverClient
,
DarwinTabletProc
,
TRUE
);
RegisterPointerDevice
(
darwinTabletStylus
);
darwinTabletStylus
->
name
=
strdup
(
"pen"
);
darwinTabletCursor
=
AddInputDevice
(
DarwinTabletProc
,
TRUE
);
darwinTabletCursor
=
AddInputDevice
(
serverClient
,
DarwinTabletProc
,
TRUE
);
RegisterPointerDevice
(
darwinTabletCursor
);
darwinTabletCursor
->
name
=
strdup
(
"cursor"
);
darwinTabletEraser
=
AddInputDevice
(
DarwinTabletProc
,
TRUE
);
darwinTabletEraser
=
AddInputDevice
(
serverClient
,
DarwinTabletProc
,
TRUE
);
RegisterPointerDevice
(
darwinTabletEraser
);
darwinTabletEraser
->
name
=
strdup
(
"eraser"
);
...
...
hw/xquartz/darwinEvents.c
View file @
387563b7
...
...
@@ -84,7 +84,7 @@ static pthread_mutex_t fd_add_lock = PTHREAD_MUTEX_INITIALIZER;
static
pthread_cond_t
fd_add_ready_cond
=
PTHREAD_COND_INITIALIZER
;
static
pthread_t
fd_add_tid
=
NULL
;
static
x
Event
*
darwinEvents
=
NULL
;
static
Event
List
*
darwinEvents
=
NULL
;
static
pthread_mutex_t
mieq_lock
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_cond_t
mieq_ready_cond
=
PTHREAD_COND_INITIALIZER
;
...
...
@@ -324,7 +324,7 @@ Bool DarwinEQInit(void) {
* here, so I don't bother.
*/
if
(
!
darwinEvents
)
{
darwinEvents
=
(
x
Event
*
)
xcalloc
(
sizeof
(
xEvent
),
GetMaximumEventsNum
());
darwinEvents
=
Init
Event
List
(
GetMaximumEventsNum
());
;
if
(
!
darwinEvents
)
FatalError
(
"Couldn't allocate event buffer
\n
"
);
...
...
@@ -450,7 +450,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
darwinEvents_lock
();
{
num_events
=
GetPointerEvents
(
darwinEvents
,
pDev
,
ev_type
,
ev_button
,
POINTER_ABSOLUTE
,
0
,
pDev
==
darwinTabletCurrent
?
5
:
2
,
valuators
);
for
(
i
=
0
;
i
<
num_events
;
i
++
)
mieqEnqueue
(
pDev
,
&
darwinEvents
[
i
]);
for
(
i
=
0
;
i
<
num_events
;
i
++
)
mieqEnqueue
(
pDev
,
darwinEvents
[
i
]
.
event
);
DarwinPokeEQ
();
}
darwinEvents_unlock
();
}
...
...
@@ -465,7 +465,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) {
darwinEvents_lock
();
{
num_events
=
GetKeyboardEvents
(
darwinEvents
,
darwinKeyboard
,
ev_type
,
keycode
+
MIN_KEYCODE
);
for
(
i
=
0
;
i
<
num_events
;
i
++
)
mieqEnqueue
(
darwinKeyboard
,
&
darwinEvents
[
i
]);
for
(
i
=
0
;
i
<
num_events
;
i
++
)
mieqEnqueue
(
darwinKeyboard
,
darwinEvents
[
i
]
.
event
);
DarwinPokeEQ
();
}
darwinEvents_unlock
();
}
...
...
@@ -493,7 +493,7 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
darwinEvents_lock
();
{
num_events
=
GetProximityEvents
(
darwinEvents
,
dev
,
ev_type
,
0
,
5
,
valuators
);
for
(
i
=
0
;
i
<
num_events
;
i
++
)
mieqEnqueue
(
dev
,
&
darwinEvents
[
i
]);
for
(
i
=
0
;
i
<
num_events
;
i
++
)
mieqEnqueue
(
dev
,
darwinEvents
[
i
]
.
event
);
DarwinPokeEQ
();
}
darwinEvents_unlock
();
}
...
...
hw/xquartz/quartzKeyboard.c
View file @
387563b7
...
...
@@ -432,7 +432,7 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
DeviceIntPtr
pDev
;
/* From ProcSetModifierMapping */
SendMappingNotify
(
MappingModifier
,
0
,
0
,
serverClient
);
SendMappingNotify
(
darwinKeyboard
,
MappingModifier
,
0
,
0
,
serverClient
);
for
(
pDev
=
inputInfo
.
devices
;
pDev
;
pDev
=
pDev
->
next
)
if
(
pDev
->
key
&&
pDev
->
coreEvents
)
SendDeviceMappingNotify
(
serverClient
,
MappingModifier
,
0
,
0
,
pDev
);
...
...
@@ -442,7 +442,7 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
if
((
pDev
->
coreEvents
||
pDev
==
inputInfo
.
keyboard
)
&&
pDev
->
key
)
assert
(
SetKeySymsMap
(
&
pDev
->
key
->
curKeySyms
,
keySyms
));
SendMappingNotify
(
MappingKeyboard
,
keySyms
->
minKeyCode
,
SendMappingNotify
(
darwinKeyboard
,
MappingKeyboard
,
keySyms
->
minKeyCode
,
keySyms
->
maxKeyCode
-
keySyms
->
minKeyCode
+
1
,
serverClient
);
for
(
pDev
=
inputInfo
.
devices
;
pDev
;
pDev
=
pDev
->
next
)
if
(
pDev
->
key
&&
pDev
->
coreEvents
)
...
...
@@ -477,7 +477,8 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
QuartzBell
,
DarwinChangeKeyboardControl
));
pthread_mutex_unlock
(
&
keyInfo_mutex
);
SwitchCoreKeyboard
(
pDev
);
// TODO: What do we do now in 1.6?
//SwitchCoreKeyboard(pDev);
DarwinKeyboardSetDeviceKeyMap
(
&
keySyms
);
}
...
...
hw/xquartz/quartzPasteboard.c
View file @
387563b7
...
...
@@ -131,7 +131,7 @@ void QuartzReadPasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nev
event
.
u
.
selectionClear
.
time
=
GetTimeInMillis
();
event
.
u
.
selectionClear
.
window
=
pSel
->
window
;
event
.
u
.
selectionClear
.
atom
=
pSel
->
selection
;
TryClientEvents
(
pSel
->
client
,
&
event
,
1
,
NoEventMask
,
TryClientEvents
(
pSel
->
client
,
dev
,
&
event
,
1
,
NoEventMask
,
NoEventMask
/*CantBeFiltered*/
,
NullGrab
);
}
...
...
hw/xquartz/xpr/xprCursor.c
View file @
387563b7
...
...
@@ -185,7 +185,7 @@ load_cursor(CursorPtr src, int screen)
* Convert the X cursor representation to native format if possible.
*/
static
Bool
QuartzRealizeCursor
(
ScreenPtr
pScreen
,
CursorPtr
pCursor
)
QuartzRealizeCursor
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
,
CursorPtr
pCursor
)
{
if
(
pCursor
==
NULL
||
pCursor
->
bits
==
NULL
)
return
FALSE
;
...
...
@@ -201,7 +201,7 @@ QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* Free the storage space associated with a realized cursor.
*/
static
Bool
QuartzUnrealizeCursor
(
ScreenPtr
pScreen
,
CursorPtr
pCursor
)
QuartzUnrealizeCursor
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
,
CursorPtr
pCursor
)
{
return
TRUE
;
}
...
...
@@ -212,7 +212,7 @@ QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* Set the cursor sprite and position.
*/
static
void
QuartzSetCursor
(
ScreenPtr
pScreen
,
CursorPtr
pCursor
,
int
x
,
int
y
)
QuartzSetCursor
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
,
CursorPtr
pCursor
,
int
x
,
int
y
)
{
QuartzCursorScreenPtr
ScreenPriv
=
CURSOR_PRIV
(
pScreen
);
...
...
@@ -245,16 +245,26 @@ QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
* Move the cursor. This is a noop for us.
*/
static
void
QuartzMoveCursor
(
ScreenPtr
pScreen
,
int
x
,
int
y
)
QuartzMoveCursor
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
,
int
x
,
int
y
)
{
}
/* TODO: New for 1.6 ... probably noop */
static
Bool
QuartzDeviceCursorInitialize
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
)
{
return
TRUE
;
}
/* TODO: New for 1.6 ... probably noop */
static
void
QuartzDeviceCursorCleanup
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
)
{
}
static
miPointerSpriteFuncRec
quartzSpriteFuncsRec
=
{
QuartzRealizeCursor
,
QuartzUnrealizeCursor
,
QuartzSetCursor
,
QuartzMoveCursor
QuartzMoveCursor
,
QuartzDeviceCursorInitialize
,
QuartzDeviceCursorCleanup
};
...
...
@@ -293,7 +303,7 @@ QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
*
*/
static
void
QuartzWarpCursor
(
ScreenPtr
pScreen
,
int
x
,
int
y
)
QuartzWarpCursor
(
DeviceIntPtr
pDev
,
ScreenPtr
pScreen
,
int
x
,
int
y
)
{
if
(
quartzServerVisible
)
{
...
...
@@ -305,8 +315,8 @@ QuartzWarpCursor(ScreenPtr pScreen, int x, int y)
CGWarpMouseCursorPosition
(
CGPointMake
(
sx
+
x
,
sy
+
y
));
}
miPointerWarpCursor
(
pScreen
,
x
,
y
);
miPointerUpdate
(
);
miPointerWarpCursor
(
pDev
,
pScreen
,
x
,
y
);
miPointerUpdate
Sprite
(
pDev
);
}
...
...
@@ -404,13 +414,15 @@ QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
WindowPtr
pWin
;
CursorPtr
pCursor
;
pWin
=
GetSpriteWindow
();