aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
Commit message (Collapse)AuthorAgeFilesLines
* Keyboard.c: simplify codeUlrich Sibiller2021-01-151-5/+3
| | | | Based on PVS Studio finding: "V547 Expression 'data' is always true."
* Keyboard.c: noXkbExtension is a BooleanUlrich Sibiller2021-01-151-2/+2
|
* nxagent: make nxagentXkbState.Initialized a BooleanUlrich Sibiller2021-01-151-1/+1
|
* nxagent: make nxagentOption Shadow a BooleanUlrich Sibiller2021-01-151-1/+1
| | | | and add the missing init code.
* Keyboard.c: improve capslock and numlock handlingUlrich Sibiller2020-10-171-0/+42
| | | | Fixes ArcticaProject/nx-libs#935
* Keyboard.c: fix indentation of ifdefUlrich Sibiller2020-10-171-2/+2
|
* Keyboard.c: free remote keybord names once no longer neededUlrich Sibiller2020-05-071-5/+9
|
* Keyboard.c: improve keyboard outputUlrich Sibiller2020-01-061-1/+1
|
* Keyboard.c: fix typoUlrich Sibiller2020-01-061-1/+1
|
* Error.c: fix format-truncation warningUlrich Sibiller2020-01-051-5/+0
| | | | | | | | | | Error.c: In function ‘nxagentGetSessionPath’: Error.c:543:62: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 253 [-Wformat-truncation=] snprintf(nxagentSessionDir, DEFAULT_STRING_LENGTH, "%s/C-%s", rootPath, nxagentSessionId); ^~ ~~~~~~~~~~~~~~~~ Error.c:543:5: note: ‘snprintf’ output 4 or more bytes (assuming 259) into a destination of size 256 snprintf(nxagentSessionDir, DEFAULT_STRING_LENGTH, "%s/C-%s", rootPath, nxagentSessionId); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* nxagent: Use XlibAtom data type where appropriateUlrich Sibiller2020-01-051-8/+4
| | | | | | | | XlibAtom should be used wherever remote atoms are handled. This is important as Xlib data types and server data types of the same name do not always have identical sizes. See also https://lists.freedesktop.org/archives/xorg-devel/2015-August/047245.html
* Keyboard.c: code simplification / scope improvementsUlrich Sibiller2020-01-051-35/+29
|
* Keyboard.c: reformat commentsUlrich Sibiller2020-01-051-23/+20
|
* nxagent: remove additional keyboard handling from Reconnect.cUlrich Sibiller2020-01-051-3/+10
| | | | | | | | At reconnect we check if a keyboard reset is required. If so, we are calling the corresponding code from Keyboard.c. No explicit keyboard code in Reconnect.c required. fixes ArcticaProject/nx-libs#886
* nxagent: central check for keyboard clone modeUlrich Sibiller2020-01-051-8/+0
|
* Keyboard.c: scope cleanupsUlrich Sibiller2020-01-051-76/+54
|
* Keyboard.c: Use __func__ at fprintf callsUlrich Sibiller2020-01-051-51/+50
|
* Keyboard.c: use "\0" instead of "0"Ulrich Sibiller2020-01-051-2/+2
|
* Keyboard.c: fix: handle empty stringUlrich Sibiller2020-01-051-0/+6
|
* Keyboard.c: condense keycode conversion tableUlrich Sibiller2019-09-291-255/+51
|
* Keyboard.c: use SAFE_XFree and SAFE_freeUlrich Sibiller2019-08-061-36/+34
|
* rework xkb device private handlingUlrich Sibiller2019-06-221-8/+0
| | | | | | | We can only free the xkbDevicePrivate because we do not know the details of any other (possible) extension. So let's limit to that one private for now and call the new xkbFreePrivates from dix (where such a function is completely missing).
* Keyboard.c: use existing define instead of hardcoced valueUlrich Sibiller2019-06-221-1/+1
|
* Keyboard.c: fix another cppcheck findingUlrich Sibiller2019-06-221-1/+2
| | | | [Keyboard.c:559]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
* Keyboard.c: rearrange code to make cppcheck happyUlrich Sibiller2019-06-221-1/+4
| | | | Otherwise it will (falsely) report "Memory pointed to by 'sessionpath' is freed twice."
* Keyboard.c: fix three memory leaksUlrich Sibiller2019-06-221-0/+4
| | | | | | | | | | | | | | | | | | | | | ==12976==ERROR: LeakSanitizer: detected memory leaks Direct leak of 6 byte(s) in 1 object(s) allocated from: #0 0x7f510b3ac810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810) #1 0x559ca29c5035 in nxagentKeyboardProc /home/uli/work/nx/ArcticaProject/nx-libs/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c:866 #2 0x7a29bff07 (<unknown module>) Direct leak of 1 byte(s) in 1 object(s) allocated from: #0 0x7f510b3ac810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810) #1 0x559ca29c509a in nxagentKeyboardProc /home/uli/work/nx/ArcticaProject/nx-libs/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c:870 #2 0x7a29bff07 (<unknown module>) Direct leak of 1 byte(s) in 1 object(s) allocated from: #0 0x7f510b3ac810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810) #1 0x559ca29c507f in nxagentKeyboardProc /home/uli/work/nx/ArcticaProject/nx-libs/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c:869 #2 0x7a29bff07 (<unknown module>) SUMMARY: AddressSanitizer: 8 byte(s) leaked in 3 allocation(s).
* various scope improvementsUlrich Sibiller2019-06-191-3/+1
|
* Fix memleaks: Free devPrivates of devices on shutdownUlrich Sibiller2019-06-191-1/+8
| | | | | | | | | | | | | | | | | | | | | | Fixes these two memory leaks identified by valgrind: ==28336== 32 (8 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 180 of 308 ==28336== at 0x48356AF: malloc (vg_replace_malloc.c:298) ==28336== by 0x4837DE7: realloc (vg_replace_malloc.c:826) ==28336== by 0x1AE322: AllocateDevicePrivate (privates.c:439) ==28336== by 0x27527B: XkbSetExtension (xkbActions.c:72) ==28336== by 0x198E9B: _RegisterPointerDevice (devices.c:361) ==28336== by 0x1DBA35: InitInput (Init.c:440) ==28336== by 0x14DBD6: main (main.c:303) ==28336== ==28336== 32 (8 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 181 of 308 ==28336== at 0x48356AF: malloc (vg_replace_malloc.c:298) ==28336== by 0x4837DE7: realloc (vg_replace_malloc.c:826) ==28336== by 0x1AE322: AllocateDevicePrivate (privates.c:439) ==28336== by 0x27527B: XkbSetExtension (xkbActions.c:72) ==28336== by 0x198F1B: _RegisterKeyboardDevice (devices.c:384) ==28336== by 0x1DBA3D: InitInput (Init.c:441) ==28336== by 0x14DBD6: main (main.c:303)
* Keyboard.c: nullify freed pointersUlrich Sibiller2019-06-191-7/+11
| | | | | | | While trying to properly free memory allocated by XKB I accidently called nxagentFreeKeyboardDeviceData twice and noticed it would cause a segfault here. As the other pointers are also nullified after being freed let's just do it here, too.
* nxagent: make nxagentX2go a BooleanUlrich Sibiller2019-05-101-3/+3
|
* Keyboard.c: clean/unify formattingUlrich Sibiller2019-05-101-13/+19
|
* Keyboard.c: improve TEST and DEBUG outputUlrich Sibiller2019-05-101-2/+3
|
* Keyboard.c: fix comment.Mike Gabriel2019-02-181-2/+1
|
* Revert "nxagent: rework Bool handling"Ulrich Sibiller2019-02-151-4/+4
| | | | | | | | | | | | This reverts commit 16cd2bbe1c4425e3fa557f9ca0723aa94a50b071. It turned out that I had missed some of the Booleans being actually tristate variables. I think I can fix this (they do not need to be tristate) but I revert this for now to get back to a working state (there are reports about non-working fullscreen mode and reconnect problems). Refers to ArcticaProject/nx-libs#772
* nxagent: rework Bool handlingUlrich Sibiller2019-02-111-4/+4
| | | | drop "== False", "== 0", "== True" and "== 0" for nxagentOptions and Traps
* nxagent: bypass X2go's keyboard configuration hackUlrich Sibiller2018-12-191-31/+80
| | | | | | | | | | | | If X2go runs in auto keyboard mode it will pass keyboard=null/null to the agent and set the keyboard afterwards with setxkbmap. This patch lets nxagent handle that situation internally (null/null will be interpreted as clone) and disables X2go's mechanism (by creating a dir that effectively blocks it; see x2gosetkeyboard) This is only activated if the agent is run as "x2goagent". Fixes ArcticaProject/nx-libs#368
* Keyboard.c: add static keyword where appropriateUlrich Sibiller2018-12-191-5/+5
|
* nxagent: simplify keycode conversion setupUlrich Sibiller2018-12-191-14/+5
|
* nxagent: store remote keyboard in global variablesUlrich Sibiller2018-12-191-111/+102
| | | | This avoids some roundtrips.
* nxagent: add additional keyboard config option rmlvoUlrich Sibiller2018-12-191-5/+29
| | | | Add possibility to pass more than model and layout via the keyboard parameter.
* nxagent: add keyboard=clone configuration optionUlrich Sibiller2018-12-191-5/+34
| | | | | | | | | | | | | | | | Specifying -keyboard clone (or keyboard=clone in options) will clone XKB keyboard from the remote x server. This way many keyboard problems will hopefully never return... Should be the default but is not (yet) for compatibility reasons. Fixes ArcticaProject/nx-libs#373 (except the "do autoconf if no keyboard is provided" feature.) References: ArcticaProject/nx-libs#240 ArcticaProject/nx-libs#368
* Keyboard.c: remove non-fitting commentUlrich Sibiller2018-12-191-6/+0
| | | | Describes a check we are not doing here anymore...
* Keyboard.c: improve creation of keyboard config fileUlrich Sibiller2018-12-191-16/+28
| | | | | | | | It will now create better working config files. References: ArcticaProject/nx-libs#239 ArcticaProject/nx-libs#368
* Keyboard.c: reformat nxagentKeycodeConversionSetupUlrich Sibiller2018-12-191-19/+18
|
* Keyboard.c: use 'variant' all over the placeUlrich Sibiller2018-12-191-4/+4
| | | | avoid mix of 'variant' and 'variants'
* Keyboard.c: rename variables to better reflect their meaningUlrich Sibiller2018-12-191-25/+25
|
* Keyboard.c: refactor keycode conversionUlrich Sibiller2018-12-191-38/+56
| | | | we'll need the remote xkb in KeyboardProc in future so let's move it up.
* Keyboard.c: move keyboard file creation to extra functionUlrich Sibiller2018-12-191-51/+57
|
* Keyboard.c: simplify even more: free stuff at one placeUlrich Sibiller2018-11-091-16/+8
|
* Keyboard.c: fix keyboard=query logicUlrich Sibiller2018-11-091-1/+1
| | | | an empty nxagentKeyboard variable is no reason to fall back to no-XKB mode