Skip to content

Commit cd7670a

Browse files
committed
Faker: Ignore Num Lock state w/ popup key sequence
Referring to 4a75e02 (2.0 beta1) and 7dbdbdc (2.1), the VirtualGL Faker's event handler historically matched both Mod1Mask and Mod2Mask in the modifier state to an Alt key sequence in VGL_GUI. In the dawn of time (AKA 2000 and late), that was correct, because Mod2Mask was used for the right Alt key. In 2025, however, Mod2Mask is used for Num Lock, and either Mod1Mask (Linux, FreeBSD) or Mod5Mask (Solaris 11) is used for the right Alt key. Thus, the modifier state will always contain Mod2Mask if Num Lock is on, so the event handler's previous logic never matched fconfig.guimod in that case. Since we don't support Solaris anymore and fconfig.guimod will only ever contain ShiftMask, ControlMask, or Mod1Mask, the correct modern solution is to mask off all other bits in the modifier state before comparing it to fconfig.guimod.
1 parent efff6ac commit cd7670a

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ rendering thread.
1111
2. Fixed an error ("undefined symbol: eglGetProcAddress") that occurred when
1212
attempting to run a GLX application using the EGL back end and `vglrun -nodl`.
1313

14+
3. Fixed an issue whereby the VirtualGL Configuration dialog did not pop up if
15+
the Num Lock key was on.
16+
1417

1518
3.1.2
1619
=====

server/faker-x11.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (C)2004 Landmark Graphics Corporation
22
// Copyright (C)2005, 2006 Sun Microsystems, Inc.
3-
// Copyright (C)2009, 2011-2016, 2018-2024 D. R. Commander
3+
// Copyright (C)2009, 2011-2016, 2018-2025 D. R. Commander
44
//
55
// This library is free software and may be redistributed and/or modified under
66
// the terms of the wxWindows Library License, Version 3.1 or (at your option)
@@ -735,16 +735,11 @@ static void handleEvent(Display *dpy, XEvent *xe)
735735
}
736736
else if(xe && xe->type == KeyPress)
737737
{
738-
unsigned int state2, state = (xe->xkey.state & (~(LockMask))) & 0xFF;
739-
state2 = fconfig.guimod;
740-
if(state2 & Mod1Mask)
741-
{
742-
state2 &= (~(Mod1Mask)); state2 |= Mod2Mask;
743-
}
738+
unsigned int state =
739+
xe->xkey.state & (ShiftMask | ControlMask | Mod1Mask);
744740
if(fconfig.gui
745741
&& KeycodeToKeysym(dpy, xe->xkey.keycode, 0) == fconfig.guikey
746-
&& (state == fconfig.guimod || state == state2)
747-
&& fconfig_getshmid() != -1)
742+
&& state == fconfig.guimod && fconfig_getshmid() != -1)
748743
VGLPOPUP(dpy, fconfig_getshmid());
749744
}
750745
else if(xe && xe->type == ClientMessage)

0 commit comments

Comments
 (0)