summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-01-05 16:11:42 -0500
committerAdam Jackson <ajax@redhat.com>2016-04-18 11:22:58 -0400
commitda9ee1eddd65d00788cef8a3becfad948c0a2168 (patch)
tree180b088395bf4a56fd09460337c1a12018f44e4d
parent2c3a3afb5104714b637c1c4aea195df73e0fa918 (diff)
xfree86: Create seat atom from the root window callback (v2)
v2: Fix swapped callback args Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--hw/xfree86/common/xf86Init.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index de51497b5..f5f407e2b 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -365,6 +365,22 @@ InstallSignalHandlers(void)
}
}
+static void
+AddSeatId(CallbackListPtr *pcbl, void *data, void *screen)
+{
+ ScreenPtr pScreen = screen;
+ Atom SeatAtom = MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE);
+ int err;
+
+ err = dixChangeWindowProperty(serverClient, pScreen->root, SeatAtom,
+ XA_STRING, 8, PropModeReplace,
+ strlen(data) + 1, data, FALSE);
+
+ if (err != Success)
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "Failed to register seat property\n");
+}
+
/* The memory storing the initial value of the XFree86_has_VT root window
* property. This has to remain available until server start-up, so we just
* use a global. */
@@ -749,26 +765,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
}
}
- if (SeatId) {
- Atom SeatAtom;
-
- SeatAtom =
- MakeAtom(SEAT_ATOM_NAME, sizeof(SEAT_ATOM_NAME) - 1, TRUE);
-
- for (i = 0; i < xf86NumScreens; i++) {
- int ret;
-
- ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex,
- SeatAtom, XA_STRING, 8,
- strlen(SeatId) + 1,
- SeatId);
- if (ret != Success) {
- xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING,
- "Failed to register seat property\n");
- }
- }
- }
-
/* If a screen uses depth 24, show what the pixmap format is */
for (i = 0; i < xf86NumScreens; i++) {
if (xf86Screens[i]->depth == 24) {
@@ -802,6 +798,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
xf86EnableIO();
}
+ if (SeatId)
+ AddCallback(&RootWindowFinalizeCallback, AddSeatId, SeatId);
+
/*
* Use the previously collected parts to setup pScreenInfo
*/