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
14d8e0a2
Commit
14d8e0a2
authored
Jul 24, 2017
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dialog.c: Add NXTransDialog() call for autograb toggling.
parent
03aa5d74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
0 deletions
+82
-0
Dialog.c
nx-X11/programs/Xserver/hw/nxagent/Dialog.c
+50
-0
Dialog.h
nx-X11/programs/Xserver/hw/nxagent/Dialog.h
+30
-0
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+2
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/Dialog.c
View file @
14d8e0a2
...
...
@@ -63,6 +63,8 @@ int nxagentEnableRandRModeDialogPid = 0;
int
nxagentDisableRandRModeDialogPid
=
0
;
int
nxagentEnableDeferModePid
=
0
;
int
nxagentDisableDeferModePid
=
0
;
int
nxagentEnableAutograbModePid
=
0
;
int
nxagentDisableAutograbModePid
=
0
;
static
int
nxagentFailedReconnectionDialogPid
=
0
;
...
...
@@ -158,6 +160,24 @@ void nxagentResetDialog(int pid)
nxagentDisableDeferModePid
=
0
;
}
else
if
(
pid
==
nxagentEnableAutograbModePid
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentResetDialog: Resetting enable autograb mode dialog pid [%d].
\n
"
,
nxagentEnableAutograbModePid
);
#endif
nxagentEnableAutograbModePid
=
0
;
}
else
if
(
pid
==
nxagentDisableAutograbModePid
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentResetDialog: Resetting disable autograb mode dialog pid [%d].
\n
"
,
nxagentDisableAutograbModePid
);
#endif
nxagentDisableAutograbModePid
=
0
;
}
}
void
nxagentLaunchDialog
(
DialogType
dialogType
)
...
...
@@ -263,6 +283,24 @@ void nxagentLaunchDialog(DialogType dialogType)
break
;
}
case
DIALOG_ENABLE_AUTOGRAB_MODE
:
{
message
=
DIALOG_ENABLE_AUTOGRAB_MODE_MESSAGE
;
type
=
DIALOG_ENABLE_AUTOGRAB_MODE_TYPE
;
local
=
DIALOG_ENABLE_AUTOGRAB_MODE_LOCAL
;
pid
=
&
nxagentEnableAutograbModePid
;
break
;
}
case
DIALOG_DISABLE_AUTOGRAB_MODE
:
{
message
=
DIALOG_DISABLE_AUTOGRAB_MODE_MESSAGE
;
type
=
DIALOG_DISABLE_AUTOGRAB_MODE_TYPE
;
local
=
DIALOG_DISABLE_AUTOGRAB_MODE_LOCAL
;
pid
=
&
nxagentDisableAutograbModePid
;
break
;
}
default:
{
#ifdef WARNING
...
...
@@ -496,6 +534,18 @@ void nxagentTerminateDialog(DialogType type)
break
;
}
case
DIALOG_ENABLE_AUTOGRAB_MODE
:
{
pid
=
nxagentEnableAutograbModePid
;
break
;
}
case
DIALOG_DISABLE_AUTOGRAB_MODE
:
{
pid
=
nxagentDisableAutograbModePid
;
break
;
}
default:
{
#ifdef WARNING
...
...
nx-X11/programs/Xserver/hw/nxagent/Dialog.h
View file @
14d8e0a2
...
...
@@ -41,6 +41,8 @@ typedef enum
DIALOG_FAILED_RECONNECTION
,
DIALOG_ENABLE_DEFER_MODE
,
DIALOG_DISABLE_DEFER_MODE
,
DIALOG_ENABLE_AUTOGRAB_MODE
,
DIALOG_DISABLE_AUTOGRAB_MODE
,
DIALOG_LAST_TAG
}
DialogType
;
...
...
@@ -54,6 +56,8 @@ extern int nxagentEnableRandRModeDialogPid;
extern
int
nxagentDisableRandRModeDialogPid
;
extern
int
nxagentEnableDeferModePid
;
extern
int
nxagentDisableDeferModePid
;
extern
int
nxagentEnableAutograbModePid
;
extern
int
nxagentDisableAutograbModePid
;
#define NXAGENTFAILEDRECONNECTIONMESSAGELENGTH 256
extern
char
nxagentFailedReconnectionMessage
[
NXAGENTFAILEDRECONNECTIONMESSAGELENGTH
];
...
...
@@ -87,6 +91,8 @@ extern void nxagentTerminateDialogs(void);
(type) == DIALOG_FAILED_RECONNECTION ? "DIALOG_FAILED_RECONNECTION" : \
(type) == DIALOG_ENABLE_DEFER_MODE ? "DIALOG_ENABLE_DEFER_MODE" : \
(type) == DIALOG_DISABLE_DEFER_MODE ? "DIALOG_DISABLE_DEFER_MODE" : \
(type) == DIALOG_ENABLE_AUTOGRAB_MODE ? "DIALOG_ENABLE_AUTGRAB_MODE" : \
(type) == DIALOG_DISABLE_AUTOGRAB_MODE ? "DIALOG_DISABLE_AUTOGRAB_MODE" : \
"UNKNOWN_DIALOG")
/*
...
...
@@ -214,5 +220,29 @@ Ctrl+Alt+E to enable it again.\
#define DIALOG_DISABLE_DEFER_MODE_LOCAL 0
#define DIALOG_ENABLE_AUTOGRAB_MODE_MESSAGE \
\
"\
Keyboard auto-grabbing mode is now enabled. You can press\n\
Ctrl+Alt+G again to disable auto-grabbing.\
"
#define DIALOG_ENABLE_AUTOGRAB_MODE_TYPE "ok"
#define DIALOG_ENABLE_AUTOGRAB_MODE_LOCAL 0
#define DIALOG_DISABLE_AUTOGRAB_MODE_MESSAGE \
\
"\
Keyboard auto-grabbing mode is now disabled. You can press\n\
Ctrl+Alt+G again to re-enable auto-grabbing.\
"
#define DIALOG_DISABLE_AUTOGRAB_MODE_TYPE "ok"
#define DIALOG_DISABLE_AUTOGRAB_MODE_LOCAL 0
#endif
/* __Dialog_H__ */
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
14d8e0a2
...
...
@@ -712,6 +712,7 @@ static void nxagentEnableAutoGrab(void)
nxagentGrabPointerAndKeyboard
(
NULL
);
nxagentChangeOption
(
AutoGrab
,
True
);
nxagentLaunchDialog
(
DIALOG_ENABLE_AUTOGRAB_MODE
);
}
static
void
nxagentDisableAutoGrab
(
void
)
...
...
@@ -722,6 +723,7 @@ static void nxagentDisableAutoGrab(void)
nxagentUngrabPointerAndKeyboard
(
NULL
);
nxagentChangeOption
(
AutoGrab
,
False
);
nxagentLaunchDialog
(
DIALOG_DISABLE_AUTOGRAB_MODE
);
}
static
void
nxagentToggleAutoGrab
(
void
)
...
...
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