interactive.c revision 606
* Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, and/or sell copies of the Software, and to permit persons * to whom the Software is furnished to do so, provided that the above * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, use * or other dealings in this Software without prior written authorization * of the copyright holder. /************************************************************ Basic boilerplate extension. This file also contains the code to make the priocntl on behalf Note that ChangePriority also sets the last client with focus If there are knobs to be added to the system, for say the nice values for the IA class, they would be added here. ********************************************************/ /* THIS IS NOT AN X CONSORTIUM STANDARD */ /* static int LocalConnection(OsCommPtr); */ /* Set via xorg.conf option in loadable module */ /* InitExtensions is called before InitClientPrivates(serverClient) so we set this timer to callback as soon as we hit WaitForSomething to initialize the serverClient */ "SolarisIA: Finished initializing (generation %ld)\n",
/* Allocate client private structure for this client */ /* Called when we first hit WaitForSomething to initialize serverClient */ /* Called when new client connects or existing client disconnects */ "SolarisIA: WindowManager closed (pid %d)\n",
The SProc* functions are here for completeness. They should never get called. But since they do the server has to eat the request and return thanks for sharing. * Loop through pids associated with client. Magically make last focus * group go non-interactive -IA_BOOST. /* Shortcut. Focus changed between two windows with same pid */ /* Remove priority boost for last focus group */ /* If no pid info for current client, then we're done here. * This can happen if we have a remote client with focus or if the client * is statically linked or if it is using a down rev version of libX11. /* Set the priority boost if it isn't already active */ /* Make sure server or wmgr isn't unset by testing for them, so * that LastPids is never set to point to the server or wmgr pid. /* Get TS class information */ /* Get IA class information */ Error(
"Error in setting egid to 0");
Error(
"Error in resetting egid");
return ~
Success;
/* Scary time; punt */ /* If process is in TS or IA class we can safely set parameters */ /* If this returns true, the process is already in the */ /* IA class, so we don't need to update it. */ default:
cmdmsg =
"UNKNOWN_CMD!!!";
break;
Error(
"Error in resetting egid");
/***************************************************************************** /* In Xsun we used the osPrivate in OsCommPtr, so this was SetOsPrivate. */ Check to see that all in current (a) are in last (b). And that a and b have the same number of members in the set. return 0;
/* definately NOT the same set */ /***************************************************************************** * Wrappers for normal procs - in Xsun we modified the original procs directly * in dix, but here we wrap them for a small performance loss but a large * increase in maintainability and ease of porting to new releases. /* If the input focus is PointerRootWin, send the event to where the pointer is if possible, then perhaps propogate up to root. */ "SolarisIA: WindowManager detected (pid %d)\n",