Bit/window gravity computations need to recompute exposures to manage the
bits which are saved by gravity during the resize computation. That's easy
for non-redirected windows where the bits are all within the parent's
pixmap. For redirected windows, we don't need to deal with this at all, so
just skip the whole re-computation adventure.
Signed-off-by: Keith Packard <keithp@keithp.com>
Spiritual revert of 1fa4de80fc. Intel's C
compiler claims to be gcc-compatible; if they're not defining the same
macros as gcc then that's their bug, not ours. Even if we were to do
this aliasing we should do it once and for all in servermd.h.
Conflicts:
Xext/xprint.c (removed in master)
config/hal.c
dix/main.c
hw/kdrive/ati/ati_cursor.c (removed in master)
hw/kdrive/i810/i810_cursor.c (removed in master)
hw/xprint/ddxInit.c (removed in master)
xkb/ddxLoad.c
Calling ->MoveCursor for anything but the HW-rendered VCP causes the
SW-rendered cursor routines to be started, including mallocs, etc. Since
miPointerMoved is called during SIGIO, this is a bad idea.
Thanks to Owen Taylor for root-causing this one.
If a TreatAsTransparent window has any area in the borderClip, that will be
added to the totalClip region for use by other windows. That's wrong.
Instead, simply empty the borderClip for TreatAsTransparent windows right up
front.
When a new device is added, calculate the event size needed if a DCCE event is
sent and set the EQ's event size to this minimum. This avoids reallocs when a
event is sent (which may happen during a SIGIO).
This extension provided bug-compatibility with pre-X11R6, but has been
stubbed out in our server since 2006 to return BadRequest when you actually
asked for it.
Add Prox events to the if-clauses with the other events
that are usually sent from the input devices.
Ensure that the event deliverers won't try to deliver
events of type '0' (some extended events doesn't have
an equivalent core-type)
Small modification by Peter Hutterer.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
When we fail an assert in miregion.c (which happens every now and then,
though I haven't yet checked up why), at least generate a segfault, so
we'll get a backtrace.
Initialise num_events to 1, so we always send a proximity event, and then
optionally valuator events. Also make sure mieq can deal with valuator
events sent after proximity events.
If we call it unconditionally, we flip the dev->spriteInfo->sprite permanently
when using XTestFakeInput (once in CheckMotion as called from the
processInputProc, another time in UpdateSpriteForScreen when we actually warp
the cursor). USFS also updates to the screen's root window unconditionally,
which is not really what we want if we haven't changed screen at all.
If a slave device is attached to a master device, then we need to send a
mapping notify to the client.
Mapping notify needs to be sent if
- different slave device but on same master
- different master
This gives you funny behaviour with the ClientPointer. When a
MappingNotify is sent to the client, the client usually responds with a
GetKeyboardMapping. This will retrieve the ClientPointer's keyboard mapping,
regardless of which keyboard sent the last mapping notify request. So
depending on the CP setting, your keyboard may change layout in each app...
Each time a different slave device sends through a master, an
DeviceClassesChangedEvent is enqueued. When this event is processed, all
classes of the matching master device are changed, and the event is sent to
the clients.
Next time the master is queried, it thus shows the evclasses of the last slave
device. The original classes are stored in the devPrivates.
TODO: if all slave devices are removed, the master's original classes need to
be restored.
For pointers: don't try to set master->valuator fields if there is no master.
For keyboards: check if device is valid before trying to access the fields in
miPointerGetScreen (btw. this disables DGA events for floating keyboards).
Also stop the hideous number of ErrorFs if we request the paired device for a
floating dev.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
This changes the module initalization order so that the GLX module initializes
after COMPOSITE. The reason for this change is to be able to initialize a
GLX visual config for the COMPOSITE ARGB visual.
Instead of the fragile setup where we filter the modes common between the
DDX generated GLX visuals and the DRI driver generated fbconfigs, we now
just take the fbconfigs returned by the DRI driver to be our supported set.
Macros defaulted to inputInfo.pointe rfor devices that weren't spriteOwners.
Changed to take the device's master device now.
This includes sticking in a number of checks and warnings that cursor
rendering won't be called for floating devices.
* dix/events.c, include/dix.h:
(UpdateSpriteForScreen): added this to update the mouse sprite context
when we switch from a pScreen to another.
* mi/mipointer.c:
(miPointerWarpCursor): as we are switching to a new pScreen,
don't forget to update the mouse sprite context.
We only get core events through the EQ in exceptional cases, so make sure we
actually swap the core keymap for XI events as well. Gives us back the ability
to have multiple keyboard layouts simultaneously.
Let the drivers only generate XI events and put those into the event queue.
When processing events, generate core events as needed. This fixes a number of
problems with XKB and the DIX in general.
The previous approach was to put core events and XI events as separate events
into the event queue. When being processed, the server had no knowledge of
them coming from the same device state change. Anything that would then change
the state of the device accordingly was in danger of changing it twice,
leading to some funny (i.e. not funny at all) results.
Emulating core events while processing XI events fixes this, there is only one
path that actually changes the device state now. Although we have to be
careful when replaying events from synced devices, otherwise we may lose
events.
Note: XI has precedence over core for passive grabs, but core events are
delivered to the client first.
This removes the wrapping added in 340911d724
When processing events from the EQ, _always_ call the processInputProc of the
matching device. For XI devices, this proc is wrapped in three layers.
Core event handling is wrapped by XI event handling, which is wrapped by XKB.
A core event now passes through XKB -> XI -> DIX.
This gets rid of a sync'd grab problem: with the previous code, core events
did disappear during a sync'd device grab on account of mieqProcessInputEvents
calling the processInputProc of the VCP/VCK instead of the actual device. This
lead to the event being processed as normal instead of being enqueued for
later replaying.
This was an attempt to avoid scratch gc creation and validation for paintwin
because that was expensive. This is not the case in current servers, and the
danger of failure to implement it correctly (as seen in all previous
implementations) is high enough to justify removing it. No performance
difference detected with x11perf -create -move -resize -circulate on Xvfb.
Leave the screen hooks for PaintWindow* in for now to avoid ABI change.
Instead of drawing to window pixmap for everything, draw to window for
background as that works for Xnest and Xdmx; draw to pixmap for borders
which neither of those X servers use.
miPaintWindow was drawing to the root window, or (sometimes) drawing to the
window after smashing the window clip list. This is losing, and easily fixed
by just drawing to the window pixmap.
over to new system.
Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
Composite's automatic redirection is a more general mechanism than the
ad-hoc BS machinery, so it's much prettier to implement the one in terms
of the other. Composite now wraps ChangeWindowAttributes and activates
automatic redirection for windows with backing store requested. The old
backing store infrastructure is completely gutted: ABI-visible structures
retain the function pointers, but they never get called, and all the
open-coded conditionals throughout the DIX layer to implement BS are gone.
Note that this is still not a strictly complete implementation of backing
store, since Composite will throw the bits away on unmap and therefore
WhenMapped and Always hints are equivalent.
The pixman headers have been located under pixman-1/ instead of pixman/ since
around 2007-08-06, and pixman-1.pc has the updated include paths to account
for this.
This reverts commit feb1b3e455.
This patch changes the semantics of manual redirect windows so that they no
longer affect the clip list of their parent. Doing this means the parent can
draw to the area covered by the child without using IncludeInferiors. More
importantly, this also means that the parent receives expose events when
that region is damaged by other actions.
Add RawDeviceEvent (pointers only for now).
This commit changes the event queue to use EventLists instead of xEvent
arrays. Only EQ is affected, event delivery still uses xEvent* (look for
comment in mieqProcessInputEvent).
RawDeviceEvents deliver driver information to the client, without clipping or
acceleration.
This adds (unconditional) support for the GE extension. Anything from now on
that sends events in MPX will have to use the GE extension. No GE, no MPX
events. GE is not actually used yet from anywhere with this commit.
You will need to update x11proto, xextproto, libX11, libXext and xcb to the
matching xge branches. Things will _NOT_ work without the updated protocol
headers and libraries.
Before putting anything on the screen, check if the GC was made for the
ScreenRec we want to render to. If not, toss the GC and create a new one. This
is not the best solution but it does the job for now. Same thing for ARGB
cursors except that it's even uglier.
Also remember the screen the cursor was rendered to and check for the right
screen in the BlockHandler, SourceValidate and a few others. Only remove or
restore the cursor if we are rendering to the same screen, otherwise we get
artefacts that are both funky and really annoying.
Requires moving the spriteTrace into the DeviceIntRec and adjusting a few
functions to take in device argument, most notably XYToWindow().
Cursor rendering on the second screen is busted.
Improve memory usage by allocating the sprite's memory only to devices that
actually have a sprite and provide means to remove a device's cursor from the
screen (more hotplugging, yay!).
This commit breaks ScreenRec's ABI.
dix: set coreGrab flag for grabs caused by GrabPointer and button presses.
remove virtual core devices from device list, only real devices are in
the list now.
Auto-pair each keyboard with a real pointer if one is available,
provides multiple keyboards automatically after startup if devices
are configured.
fix GuessFreePointerDevice() to do what it's supposed to do.
mi: fix: call miPointerMove from miPointerWarpCursor.
fix: remove unused id field from miCursorInfoRec
don't update sprite for virtual core pointer.
of errors.
Some copyright notices.
misprite.c passes DeviceIntPtr around and down to DC (previously
miCursorInfoPtr and the plain device id).
Large cleanup in misprite.c to avoid code duplication.
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX
adding DeviceIntPtr parameter to ScreenRec's cursor functions.
cleanup of miPointer code to use same scheme in each function
dix: MPHasCursor() function determines checking whether to invoke
cursor rendering.
animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies
on the core pointer right now.
xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on
the core pointer right now.
rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on
the core pointer right now.
ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on
the core pointer right now.
fixed miSpriteRealize to use passed pDev argument instead of looping.
dix: changed sprite dependency and added MPX functionality to parts of
events.c (XineramaChangeToCursor, XineramaCheckPhysLimits,
XineramaConstrainCursor)
Xi: fix: accessing other->buttons for keyboard segfaulted the server
mi: core pointer was checked twice in miSpriteReportDamage,
miSpriteInstallColormap, miSpriteStoreColors, miSpriteSaveDoomedAreas
and miSpriteRealiseCursor
using damage bug (see comment in file) to avoid artefacts
added SpriteRecs for MPX devices
changed sprite dependency and added MPX functionality to parts
of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion,
CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits,
PointerConfinedToScreen)
added DeviceIntRec param to GetSpritePosition(). This required some
minor changes in ddx, xtest, xkb and xfixes.
mi: changed miPointer to pointer instead of static struct.
added id field to miCursorInfoPtr, required to pass through to miDC
core pointer uses mpCursors array as well.
added miDCBufferRec for future use with MPX
TAG: MPX_BEFORE_MIDC_API_BREAK
added miCursorInfoRec to contain info of the MPX cursors.
calling miUpdatePointerSprite() from event queue for MPX devices.
adding device-specific processing to miPointer*() functions.
dix: Call to SetCursorPosition in CheckMotion() temporarily disabled.
xfree86/common: call to miPointerUpdateSprite() disabled, is done from the EQ
NOTE: This build will not display cursor images.
BUG: The second mouse does to take correct x coordinates.
mi:
added miMPPointers array to mipointer.c
added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer
we use inputInfo.pointer as standard value. ABI BREAK!
ramdac:
forcing failed HW Cursor initialisation. MPX needs software rendering.
changes to use new miPointerSpriteFunc (this required externing
inputInfo, should probably be fixed at a later point).
RAC: changes to use new miPointerSpriteFuncs.
mieq: avoid merging events from different devices in mieqEnqueue()
xfree86/common
isMPdev field used from xf86ActivateDevice(), xf86PostMotionEvent()
and xf86PostButtonEvent()
Fix up prototypes for PrintChildren and PrintWindowTree in the dix.
Make miPrintRegion be unconditionally defined, and move the prototype into
regionstr.h.
Change a bunch of ScreenPtr pScreen = foo; to
ScreenPtr pScreen; pScreen = foo; in window.c, so we avoid unused variable
references (as inline REGION_* doesn't reference pScreen).
Move the keymap copying to event processing time (in
ProcessInputEvents), instead of being at event enqueuing time.
Break SetCore{Pointer,Keyboard} out into separate functions.
Change mieqEnqueue to take a device pointer, that asks for the
_original_ device associated with this event.
Update mipointer API to take a device argument to (almost) all functions,
and split miPointerAbsoluteCursor into a couple of separate functions.
Remove miPointerAbsoluteCursor call from mieq, as we now deal with it in
GetPointerEvents.
Make miPointerSetPosition (successor of miPointerAbsoluteCursor) take
pointers to x and y, so it can return the clipped values.
Modify callers of miPointer*() functions to generally use the new
functions.
This should fix things with multi-head setups.
Deprecate miPointer functions which don't take a device pointer. Pointer
movement should be handled through GetPointerEvents, and functions which
take a device as an argument (e.g. miPointerPosition) will be added.
Get rid of almost all uses of these definitions. They're still defined for
delinquent out-of-tree drivers, and also for the Mesa build. As well as
for miinitext.c. But largely gone.