Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
602d4b82
Commit
602d4b82
authored
Sep 05, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Sep 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Events.c: add nxagentSwitchEventsAllScreens helper
parent
15ac7a80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
35 deletions
+19
-35
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+19
-35
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
602d4b82
...
...
@@ -3746,18 +3746,29 @@ int nxagentHandleReparentNotify(XEvent* X)
return
1
;
}
void
nxagentEnableKeyboardEvents
(
void
)
/*
* Helper for nxagent(Enable|Disable)(Keyboard|Pointer)Events
*/
static
void
nxagentSwitchEventsAllScreens
(
Mask
mask
,
Bool
enable
)
{
Mask
mask
=
nxagentGetDefaultEventMask
();
Mask
new
mask
=
nxagentGetDefaultEventMask
();
mask
|=
NXAGENT_KEYBOARD_EVENT_MASK
;
if
(
enable
)
newmask
|=
mask
;
else
newmask
&=
~
mask
;
nxagentSetDefaultEventMask
(
mask
);
nxagentSetDefaultEventMask
(
new
mask
);
for
(
int
i
=
0
;
i
<
nxagentNumScreens
;
i
++
)
{
XSelectInput
(
nxagentDisplay
,
nxagentDefaultWindows
[
i
],
mask
);
XSelectInput
(
nxagentDisplay
,
nxagentDefaultWindows
[
i
],
new
mask
);
}
}
void
nxagentEnableKeyboardEvents
(
void
)
{
nxagentSwitchEventsAllScreens
(
NXAGENT_KEYBOARD_EVENT_MASK
,
True
);
XkbSelectEvents
(
nxagentDisplay
,
XkbUseCoreKbd
,
NXAGENT_KEYBOARD_EXTENSION_EVENT_MASK
,
...
...
@@ -3766,46 +3777,19 @@ void nxagentEnableKeyboardEvents(void)
void
nxagentDisableKeyboardEvents
(
void
)
{
Mask
mask
=
nxagentGetDefaultEventMask
();
mask
&=
~
NXAGENT_KEYBOARD_EVENT_MASK
;
nxagentSetDefaultEventMask
(
mask
);
for
(
int
i
=
0
;
i
<
nxagentNumScreens
;
i
++
)
{
XSelectInput
(
nxagentDisplay
,
nxagentDefaultWindows
[
i
],
mask
);
}
nxagentSwitchEventsAllScreens
(
NXAGENT_KEYBOARD_EVENT_MASK
,
False
);
XkbSelectEvents
(
nxagentDisplay
,
XkbUseCoreKbd
,
0x0
,
0x0
);
}
void
nxagentEnablePointerEvents
(
void
)
{
Mask
mask
=
nxagentGetDefaultEventMask
();
mask
|=
NXAGENT_POINTER_EVENT_MASK
;
nxagentSetDefaultEventMask
(
mask
);
for
(
int
i
=
0
;
i
<
nxagentNumScreens
;
i
++
)
{
XSelectInput
(
nxagentDisplay
,
nxagentDefaultWindows
[
i
],
mask
);
}
nxagentSwitchEventsAllScreens
(
NXAGENT_POINTER_EVENT_MASK
,
True
);
}
void
nxagentDisablePointerEvents
(
void
)
{
Mask
mask
=
nxagentGetDefaultEventMask
();
mask
&=
~
NXAGENT_POINTER_EVENT_MASK
;
nxagentSetDefaultEventMask
(
mask
);
for
(
int
i
=
0
;
i
<
nxagentNumScreens
;
i
++
)
{
XSelectInput
(
nxagentDisplay
,
nxagentDefaultWindows
[
i
],
mask
);
}
nxagentSwitchEventsAllScreens
(
NXAGENT_POINTER_EVENT_MASK
,
False
);
}
void
nxagentSendFakeKey
(
int
key
)
...
...
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