mbsmemb_update.c revision 919
98N/A/* Copyright 1999 Sun Microsystems, Inc. All rights reserved. 98N/A * Use is subject to license terms. 98N/A * Permission is hereby granted, free of charge, to any person obtaining a 98N/A * copy of this software and associated documentation files (the "Software"), 98N/A * to deal in the Software without restriction, including without limitation 98N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 98N/A * and/or sell copies of the Software, and to permit persons to whom the 98N/A * Software is furnished to do so, subject to the following conditions: 98N/A * The above copyright notice and this permission notice (including the next 98N/A * paragraph) shall be included in all copies or substantial portions of the 98N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 98N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 98N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 98N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 98N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 98N/A * DEALINGS IN THE SOFTWARE. 98N/A** Routines of the update phase that apply equally to both types of 355N/A** multibuffer set members, windows and multibuffers. 98N/A** The update phase entry routine for mbufset members. 98N/A** Called if the master change count of the shared info 98N/A** differs from the last recorded count in the client structure. 98N/A /* check the real change count that we saved away */ 98N/A /* establish the new real lock subject */ 98N/A /* save last lock subject. This may be used later in the update phase */ 98N/A /* start out assuming we're not aliased. This may change if we detect 98N/A aliasing later in the update phase */ 98N/A /* the first thing we do is distinguish between locking a window 98N/A and a multibuffer. The update logic is different */ 98N/A /* save the real change count */ 98N/A /* For the MT case, make sure that this update function gets called 98N/A * the next time around, so overwrite the change count to make it 98N/A** See if the shared info of the main window is still valid. 98N/A** Nonzero is returned if it is no longer valid and has become ** The way we deal with any composition change is to destroy the old ** multibuffer set and establish a new one. /* check to see if this is an actual composition change or simply /* no change -- must be only a display change */ /* this is a real composition change. Destroy the old mbufset (if any) /* remember whether window was previously multibuffered. This is used later in the update phase to determine the reason for the /* destroy the old one */ /* TODO: really the only way we have of responding to this is treat it as a zombie. It's not ideal, but what else can we do? */ ** If a render buffer notification function has been registered ** and the current effective lock subject differs from the current ** write buffer, call the notification function to change the render /* has client registered the notification function? */ /* we only need to notify in single-address access mode */ * Only notify if rend buf is different from what we want it to be * Note: we treat the write buffer index as the render buffer and ignore /* update the shared info so both the server and other clients can see and react to the change */ ** A derivative change is one which is dependent on changes discovered ** earlier in the update phase (i.e. the basic changes). We determine here which ones need ** to be reported. Derivative changes may be reported along with ** the basic changes. The derivative changes in common for mbufset ** members are: site change. /* report both a site change and a clip for zombies. This is simply more insurance that the client will sync up with the null clip. */ /* check for first time */ /* check for cache change */ /* check for alias change */ /* check for mbufset composition change */ ** If we can report any changes through notification, do so now. /* report any mbufset change */ /* there are no notify functions for the following: clip, cursor, bstore, cache */ /* check for window devinfo change */ /* check for nonviewable mbuf devinfo change */ /* Note: viewable mbufs don't have dev info */ /* client must find out through dga_draw_sitechg */ /* figure out reason for change */ /* this might happen if the mbufset was activated and then, in the same update phase, deactivated. In this case, allow it, but just don't report any changes */ /* client must find out through dga_draw_mbchg */ /* client must find out through dga_draw_sitechg */