aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-09-06 14:56:46 +0200
committerUlrich Sibiller <uli42@gmx.de>2020-01-05 22:38:15 +0100
commitcb283d4aa42fb8564cf1e8f3760517dd74b7d590 (patch)
tree5381a7e25f43c499c71e798004f2097a9a7f0f8c /nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
parent58415b5609c13c8efe58a674366f136f6217e060 (diff)
downloadnx-libs-cb283d4aa42fb8564cf1e8f3760517dd74b7d590.tar.gz
nx-libs-cb283d4aa42fb8564cf1e8f3760517dd74b7d590.tar.bz2
nx-libs-cb283d4aa42fb8564cf1e8f3760517dd74b7d590.zip
Keyboard.c: code simplification / scope improvements
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c64
1 files changed, 29 insertions, 35 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 1ff058659..faabb2ebe 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -312,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,
@@ -426,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);
@@ -867,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;
@@ -940,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();
@@ -1091,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