Skip to content

Commit 93254d3

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 8bef8cf commit 93254d3

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
@@ -63,6 +63,9 @@ rendering thread.
6363
13. Fixed an error ("undefined symbol: eglGetProcAddress") that occurred when
6464
attempting to run a GLX application using the EGL back end and `vglrun -nodl`.
6565

66+
14. Fixed an issue whereby the VirtualGL Configuration dialog did not pop up if
67+
the Num Lock key was on.
68+
6669

6770
3.0.2
6871
=====

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)
@@ -714,16 +714,11 @@ static void handleEvent(Display *dpy, XEvent *xe)
714714
}
715715
else if(xe && xe->type == KeyPress)
716716
{
717-
unsigned int state2, state = (xe->xkey.state & (~(LockMask))) & 0xFF;
718-
state2 = fconfig.guimod;
719-
if(state2 & Mod1Mask)
720-
{
721-
state2 &= (~(Mod1Mask)); state2 |= Mod2Mask;
722-
}
717+
unsigned int state =
718+
xe->xkey.state & (ShiftMask | ControlMask | Mod1Mask);
723719
if(fconfig.gui
724720
&& KeycodeToKeysym(dpy, xe->xkey.keycode, 0) == fconfig.guikey
725-
&& (state == fconfig.guimod || state == state2)
726-
&& fconfig_getshmid() != -1)
721+
&& state == fconfig.guimod && fconfig_getshmid() != -1)
727722
VGLPOPUP(dpy, fconfig_getshmid());
728723
}
729724
else if(xe && xe->type == ClientMessage)

0 commit comments

Comments
 (0)