diff --git a/unix/xserver/hw/vnc/InputXKB.c b/unix/xserver/hw/vnc/InputXKB.c
index a9bd11d..7b54b43 100644
--- a/unix/xserver/hw/vnc/InputXKB.c
+++ b/unix/xserver/hw/vnc/InputXKB.c
@@ -214,10 +214,7 @@ void vncPrepareInputDevices(void)

 unsigned vncGetKeyboardState(void)
 {
-	DeviceIntPtr master;
-
-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
-	return XkbStateFieldFromRec(&master->key->xkbInfo->state);
+	return XkbStateFieldFromRec(&vncKeyboardDev->master->key->xkbInfo->state);
 }

 unsigned vncGetLevelThreeMask(void)
@@ -238,7 +235,7 @@ unsigned vncGetLevelThreeMask(void)
 			return 0;
 	}

-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;

 	act = XkbKeyActionPtr(xkb, keycode, state);
 	if (act == NULL)
@@ -263,7 +260,7 @@ KeyCode vncPressShift(void)
 	if (state & ShiftMask)
 		return 0;

-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		XkbAction *act;
 		unsigned char mask;
@@ -303,7 +300,7 @@ size_t vncReleaseShift(KeyCode *keys, size_t maxKeys)

 	count = 0;

-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
+	master = vncKeyboardDev->master;
 	xkb = master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		XkbAction *act;
@@ -359,7 +356,7 @@ KeyCode vncPressLevelThree(void)
 			return 0;
 	}

-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;

 	act = XkbKeyActionPtr(xkb, keycode, state);
 	if (act == NULL)
@@ -390,7 +387,7 @@ size_t vncReleaseLevelThree(KeyCode *keys, size_t maxKeys)

 	count = 0;

-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
+	master = vncKeyboardDev->master;
 	xkb = master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		XkbAction *act;
@@ -433,7 +430,7 @@ KeyCode vncKeysymToKeycode(KeySym keysym, unsigned state, unsigned *new_state)
 	if (new_state != NULL)
 		*new_state = state;

-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;
 	for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
 		unsigned int state_out;
 		KeySym dummy;
@@ -511,7 +508,7 @@ int vncIsAffectedByNumLock(KeyCode keycode)
 	if (numlock_keycode == 0)
 		return 0;

-	xkb = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
+	xkb = vncKeyboardDev->master->key->xkbInfo->desc;

 	act = XkbKeyActionPtr(xkb, numlock_keycode, state);
 	if (act == NULL)
@@ -545,7 +542,7 @@ KeyCode vncAddKeysym(KeySym keysym, unsigned state)
 	KeySym *syms;
 	KeySym upper, lower;

-	master = GetMaster(vncKeyboardDev, KEYBOARD_OR_FLOAT);
+	master = vncKeyboardDev->master;
 	xkb = master->key->xkbInfo->desc;
 	for (key = xkb->max_key_code; key >= xkb->min_key_code; key--) {
 		if (XkbKeyNumGroups(xkb, key) == 0)
