aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 22:46:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 22:46:24 +0100
commita261b72435d7d30dbe36529a51fc53f6ade34dff (patch)
treefde666b59abbe3bdf0ed574147344c0d25075b03 /nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
parent0e2b7479cd4567128fbcd975e5376744d78cd416 (diff)
parentadca0cc92abed6f7f6184b91d807a4befb80e856 (diff)
downloadnx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.tar.gz
nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.tar.bz2
nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.zip
Merge branch 'uli42-pr/code_cleanup' into 3.6.x
Attributes GH PR #869: https://github.com/ArcticaProject/nx-libs/pull/869
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c107
1 files changed, 49 insertions, 58 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index a79052080..faabb2ebe 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -104,10 +104,9 @@ static void nxagentWriteKeyboardFile(char *rules, char *model, char *layout, cha
#endif
/*
- * Unfortunately we cannot just include XKBlib.h.
- * It conflicts with the server side definitions
- * of the same symbols. This is more a X problem
- * than our.
+ * Unfortunately we cannot just include XKBlib.h. It conflicts with
+ * the server side definitions of the same symbols. This is more a X
+ * problem than our.
*/
#ifdef XKB
@@ -158,8 +157,7 @@ static char *nxagentRemoteOptions = NULL;
XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 };
/*
- * Keyboard status, updated through XKB
- * events.
+ * Keyboard status, updated through XKB events.
*/
XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, 0 };
@@ -283,9 +281,8 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
/*
* We want to prevent agent generating auto-repeated
- * keystrokes. Let's intercept any attempt by appli-
- * cations to change the default timeouts on the
- * nxagent device.
+ * keystrokes. Let's intercept any attempt by appli- cations to
+ * change the default timeouts on the nxagent device.
*/
#ifdef TEST
@@ -305,8 +302,8 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
#endif
/*
- * If enabled, propagate the changes to the
- * devices attached to the real X server.
+ * If enabled, propagate the changes to the devices attached to the
+ * real X server.
*/
if (nxagentOption(DeviceControl))
@@ -315,10 +312,7 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
fprintf(stderr, "%s: WARNING! Propagating changes to keyboard settings.\n", __func__);
#endif
- unsigned long value_mask = KBKeyClickPercent |
- KBBellPercent |
- KBBellPitch |
- KBBellDuration;
+ unsigned long value_mask = KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration;
XKeyboardControl values = {
.key_click_percent = ctrl->click,
@@ -328,8 +322,8 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
};
/*
- * Don't propagate the auto repeat mode. It is forced to be
- * off in the agent server.
+ * Don't propagate the auto repeat mode. It is forced to be off in
+ * the agent server.
*
* value_mask |= KBAutoRepeatMode;
* values.auto_repeat_mode = ctrl->autoRepeat ?
@@ -339,9 +333,9 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
XChangeKeyboardControl(nxagentDisplay, value_mask, &values);
/*
- * At this point, we need to walk through the vector and
- * compare it to the current server vector. If there are
- * differences, report them.
+ * At this point, we need to walk through the vector and compare
+ * it to the current server vector. If there are differences,
+ * report them.
*/
value_mask = KBLed | KBLedMode;
@@ -403,11 +397,11 @@ N/A
#endif
/*
- * Prevent agent from generating auto-repeat keystroke.
- * Note that this is working only if XKB is enabled.
- * A better solution should account cases where XKB is
- * not available. Check also the behaviour of the
- * DeviceControl nxagent option.
+ * Prevent agent from generating auto-repeat keystroke. Note
+ * that this is working only if XKB is enabled. A better
+ * solution should account cases where XKB is not
+ * available. Check also the behaviour of the DeviceControl
+ * nxagent option.
*/
XkbDfltRepeatDelay = ~ 0;
@@ -429,10 +423,9 @@ N/A
#ifdef _XSERVER64
{
KeySym64 *keymap64 = XGetKeyboardMapping(nxagentDisplay,
- min_keycode,
- max_keycode - min_keycode + 1,
- &mapWidth);
-
+ min_keycode,
+ max_keycode - min_keycode + 1,
+ &mapWidth);
if (keymap64 == NULL)
{
XFreeModifiermap(modifier_keymap);
@@ -607,8 +600,8 @@ XkbError:
}
/*
- * There is no description for pc105 on Solaris.
- * Need to revert to the closest approximation.
+ * There is no description for pc105 on Solaris. Need to
+ * revert to the closest approximation.
*/
#ifdef TEST
@@ -870,7 +863,6 @@ void nxagentNotifyKeyboardChanges(int oldMinKeycode, int oldMaxKeycode)
#endif
xEvent event = {0};
-
event.u.u.type = MappingNotify;
event.u.mappingNotify.request = MappingKeyboard;
event.u.mappingNotify.firstKeyCode = inputInfo.keyboard -> key -> curKeySyms.minKeyCode;
@@ -943,12 +935,11 @@ int nxagentResetKeyboard(void)
}
#endif
- dev->key=NULL;
+ dev->key = NULL;
}
- dev->focus=NULL;
-
- dev->kbdfeed=NULL;
+ dev->focus = NULL;
+ dev->kbdfeed = NULL;
#ifdef XKB
nxagentTuneXkbWrapper();
@@ -1094,37 +1085,37 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if (dev->key)
{
- #ifdef XKB
- if (noXkbExtension == 0 && dev->key->xkbInfo)
- {
- XkbFreeInfo(dev->key->xkbInfo);
- dev->key->xkbInfo = NULL;
- }
- #endif
+ #ifdef XKB
+ if (noXkbExtension == 0 && dev->key->xkbInfo)
+ {
+ XkbFreeInfo(dev->key->xkbInfo);
+ dev->key->xkbInfo = NULL;
+ }
+ #endif
- SAFE_free(dev->key->curKeySyms.map);
- SAFE_free(dev->key->modifierKeyMap);
- SAFE_free(dev->key);
+ SAFE_free(dev->key->curKeySyms.map);
+ SAFE_free(dev->key->modifierKeyMap);
+ SAFE_free(dev->key);
}
if (dev->focus)
{
- SAFE_free(dev->focus->trace);
- SAFE_free(dev->focus);
+ SAFE_free(dev->focus->trace);
+ SAFE_free(dev->focus);
}
if (dev->kbdfeed)
{
- for (KbdFeedbackPtr k = dev->kbdfeed, knext; k; k = knext)
- {
- knext = k->next;
- #ifdef XKB
- if (k->xkb_sli)
- XkbFreeSrvLedInfo(k->xkb_sli);
- #endif
- SAFE_free(k);
- }
- dev->kbdfeed = NULL;
+ for (KbdFeedbackPtr k = dev->kbdfeed, knext; k; k = knext)
+ {
+ knext = k->next;
+ #ifdef XKB
+ if (k->xkb_sli)
+ XkbFreeSrvLedInfo(k->xkb_sli);
+ #endif
+ SAFE_free(k);
+ }
+ dev->kbdfeed = NULL;
}
#ifdef DEBUG