Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
xserver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adam Jackson
xserver
Commits
25ebb9db
Commit
25ebb9db
authored
Jan 22, 2014
by
Keith Packard
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'whot/for-keith'
parents
409e8e29
71baa466
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
9 deletions
+81
-9
Xi/exevents.c
Xi/exevents.c
+18
-1
dix/events.c
dix/events.c
+5
-1
dix/grabs.c
dix/grabs.c
+5
-6
hw/kdrive/ephyr/ephyr.c
hw/kdrive/ephyr/ephyr.c
+26
-1
os/utils.c
os/utils.c
+27
-0
No files found.
Xi/exevents.c
View file @
25ebb9db
...
...
@@ -1783,8 +1783,25 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
DeliverDeviceEvents
(
GetSpriteWindow
(
device
),
(
InternalEvent
*
)
event
,
NullGrab
,
NullWindow
,
device
);
if
(
deactivateDeviceGrab
==
TRUE
)
if
(
deactivateDeviceGrab
==
TRUE
)
{
(
*
device
->
deviceGrab
.
DeactivateGrab
)
(
device
);
if
(
!
IsMaster
(
device
)
&&
!
IsFloating
(
device
))
{
int
flags
,
num_events
=
0
;
InternalEvent
dce
;
flags
=
(
IsPointerDevice
(
device
))
?
DEVCHANGE_POINTER_EVENT
:
DEVCHANGE_KEYBOARD_EVENT
;
UpdateFromMaster
(
&
dce
,
device
,
flags
,
&
num_events
);
BUG_WARN
(
num_events
>
1
);
if
(
num_events
==
1
)
ChangeMasterDeviceClasses
(
GetMaster
(
device
,
MASTER_ATTACHED
),
&
dce
.
changed_event
);
}
}
event
->
detail
.
key
=
key
;
}
...
...
dix/events.c
View file @
25ebb9db
...
...
@@ -3961,6 +3961,8 @@ CheckPassiveGrabsOnWindow(WindowPtr pWin,
return
NULL
;
tempGrab
=
AllocGrab
(
NULL
);
if
(
tempGrab
==
NULL
)
return
NULL
;
/* Fill out the grab details, but leave the type for later before
* comparing */
...
...
@@ -5056,7 +5058,7 @@ ProcUngrabPointer(ClientPtr client)
* @param other_mode GrabModeSync or GrabModeAsync
* @param status Return code to be returned to the caller.
*
* @returns Success or BadValue.
* @returns Success or BadValue
or BadAlloc
.
*/
int
GrabDevice
(
ClientPtr
client
,
DeviceIntPtr
dev
,
...
...
@@ -5137,6 +5139,8 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
GrabPtr
tempGrab
;
tempGrab
=
AllocGrab
(
NULL
);
if
(
tempGrab
==
NULL
)
return
BadAlloc
;
tempGrab
->
next
=
NULL
;
tempGrab
->
window
=
pWin
;
...
...
dix/grabs.c
View file @
25ebb9db
...
...
@@ -199,12 +199,11 @@ AllocGrab(const GrabPtr src)
free
(
grab
);
grab
=
NULL
;
}
}
if
(
src
&&
!
CopyGrab
(
grab
,
src
))
{
free
(
grab
->
xi2mask
);
free
(
grab
);
grab
=
NULL
;
else
if
(
src
&&
!
CopyGrab
(
grab
,
src
))
{
free
(
grab
->
xi2mask
);
free
(
grab
);
grab
=
NULL
;
}
}
return
grab
;
...
...
hw/kdrive/ephyr/ephyr.c
View file @
25ebb9db
...
...
@@ -1008,6 +1008,29 @@ ephyrProcessButtonRelease(xcb_generic_event_t *xev)
KdEnqueuePointerEvent
(
ephyrMouse
,
mouseState
|
KD_MOUSE_DELTA
,
0
,
0
,
0
);
}
/* Xephyr wants ctrl+shift to grab the window, but that conflicts with
ctrl+alt+shift key combos. Remember the modifier state on key presses and
releases, if mod1 is pressed, we need ctrl, shift and mod1 released
before we allow a shift-ctrl grab activation.
note: a key event contains the mask _before_ the current key takes
effect, so mod1_was_down will be reset on the first key press after all
three were released, not on the last release. That'd require some more
effort.
*/
static
int
ephyrUpdateGrabModifierState
(
int
state
)
{
static
int
mod1_was_down
=
0
;
if
((
state
&
(
XCB_MOD_MASK_CONTROL
|
XCB_MOD_MASK_SHIFT
|
XCB_MOD_MASK_1
))
==
0
)
mod1_was_down
=
0
;
else
if
(
state
&
XCB_MOD_MASK_1
)
mod1_was_down
=
1
;
return
mod1_was_down
;
}
static
void
ephyrProcessKeyPress
(
xcb_generic_event_t
*
xev
)
{
...
...
@@ -1018,6 +1041,7 @@ ephyrProcessKeyPress(xcb_generic_event_t *xev)
return
;
}
ephyrUpdateGrabModifierState
(
key
->
state
);
ephyrUpdateModifierState
(
key
->
state
);
KdEnqueueKeyboardEvent
(
ephyrKbd
,
key
->
detail
,
FALSE
);
}
...
...
@@ -1029,6 +1053,7 @@ ephyrProcessKeyRelease(xcb_generic_event_t *xev)
xcb_key_release_event_t
*
key
=
(
xcb_key_release_event_t
*
)
xev
;
static
xcb_key_symbols_t
*
keysyms
;
static
int
grabbed_screen
=
-
1
;
int
mod1_down
=
ephyrUpdateGrabModifierState
(
key
->
state
);
if
(
!
keysyms
)
keysyms
=
xcb_key_symbols_alloc
(
conn
);
...
...
@@ -1049,7 +1074,7 @@ ephyrProcessKeyRelease(xcb_generic_event_t *xev)
hostx_set_win_title
(
screen
,
"(ctrl+shift grabs mouse and keyboard)"
);
}
else
{
else
if
(
!
mod1_down
)
{
/* Attempt grab */
xcb_grab_keyboard_cookie_t
kbgrabc
=
xcb_grab_keyboard
(
conn
,
...
...
os/utils.c
View file @
25ebb9db
...
...
@@ -600,6 +600,10 @@ UseMsg(void)
static
int
VerifyDisplayName
(
const
char
*
d
)
{
int
i
;
int
period_found
=
FALSE
;
int
after_period
=
0
;
if
(
d
==
(
char
*
)
0
)
return
0
;
/* null */
if
(
*
d
==
'\0'
)
...
...
@@ -610,6 +614,29 @@ VerifyDisplayName(const char *d)
return
0
;
/* must not equal "." or ".." */
if
(
strchr
(
d
,
'/'
)
!=
(
char
*
)
0
)
return
0
;
/* very important!!! */
/* Since we run atoi() on the display later, only allow
for digits, or exception of :0.0 and similar (two decimal points max)
*/
for
(
i
=
0
;
i
<
strlen
(
d
);
i
++
)
{
if
(
!
isdigit
(
d
[
i
]))
{
if
(
d
[
i
]
!=
'.'
||
period_found
)
return
0
;
period_found
=
TRUE
;
}
else
if
(
period_found
)
after_period
++
;
if
(
after_period
>
2
)
return
0
;
}
/* don't allow for :0. */
if
(
period_found
&&
after_period
==
0
)
return
0
;
if
(
atol
(
d
)
>
INT_MAX
)
return
0
;
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment