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>
This commit is contained in:
		
							parent
							
								
									2c3a3afb51
								
							
						
					
					
						commit
						da9ee1eddd
					
				| 
						 | 
					@ -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
 | 
					/* 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
 | 
					 * property.  This has to remain available until server start-up, so we just
 | 
				
			||||||
 * use a global. */
 | 
					 * 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 */
 | 
					        /* If a screen uses depth 24, show what the pixmap format is */
 | 
				
			||||||
        for (i = 0; i < xf86NumScreens; i++) {
 | 
					        for (i = 0; i < xf86NumScreens; i++) {
 | 
				
			||||||
            if (xf86Screens[i]->depth == 24) {
 | 
					            if (xf86Screens[i]->depth == 24) {
 | 
				
			||||||
| 
						 | 
					@ -802,6 +798,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
 | 
				
			||||||
            xf86EnableIO();
 | 
					            xf86EnableIO();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (SeatId)
 | 
				
			||||||
 | 
					        AddCallback(&RootWindowFinalizeCallback, AddSeatId, SeatId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Use the previously collected parts to setup pScreenInfo
 | 
					     * Use the previously collected parts to setup pScreenInfo
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue