1
/*********************************************************
2
* Copyright (C) 2007 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
22
* Unity: Guest window manager integration service.
24
* This file implements the guest-side Unity agent generally used as part of the
25
* Tools Core Services Unity plugin. It contains the platform-agnostic entry points
26
* for Unity window operations and establishes the context for the platform specific
27
* window enumeration process that exports data from the guest window tracker to
30
* UnityWindowTracker updates are sent to the MKS in two ways:
31
* @li @ref UNITY_RPC_GET_UPDATE GuestRpc (host-to-guest).
32
* @li @ref UNITY_RPC_PUSH_UPDATE_CMD GuestRpc (guest-to-host).
34
* @note Looking for the old "unity.get.update" return syntax? See @ref
35
* UNITY_RPC_GET_UPDATE and @ref UnityGetUpdateReturn instead.
47
#include "unityWindowTracker.h"
48
#include "unityCommon.h"
51
#include "unityPlatform.h"
52
#include "unityDebug.h"
53
#include "vmware/tools/unityevents.h"
54
#include "vmware/tools/plugin.h"
57
#include <glib-object.h>
60
* Singleton object for tracking the state of the service.
68
static void UnityUpdateCallbackFn(void *param, UnityUpdate *update);
70
static void UnitySetAddHiddenWindows(Bool enabled);
71
static void UnitySetInterlockMinimizeOperation(Bool enabled);
72
static void UnitySetSendWindowContents(Bool enabled);
73
static void FireEnterUnitySignal(gpointer serviceObj, gboolean entered);
74
static void UnitySetDisableCompositing(Bool disabled);
77
* Dispatch table for Unity window commands. All commands performing actions on
78
* guest unity windows go here.
83
Bool (*exec)(UnityPlatform *up, UnityWindowId window);
86
static UnityCommandElem unityCommandTable[] = {
87
{ UNITY_RPC_WINDOW_CLOSE, UnityPlatformCloseWindow },
88
{ UNITY_RPC_WINDOW_SHOW, UnityPlatformShowWindow },
89
{ UNITY_RPC_WINDOW_HIDE, UnityPlatformHideWindow },
90
{ UNITY_RPC_WINDOW_MINIMIZE, UnityPlatformMinimizeWindow },
91
{ UNITY_RPC_WINDOW_UNMINIMIZE, UnityPlatformUnminimizeWindow },
92
{ UNITY_RPC_WINDOW_MAXIMIZE, UnityPlatformMaximizeWindow },
93
{ UNITY_RPC_WINDOW_UNMAXIMIZE, UnityPlatformUnmaximizeWindow },
94
{ UNITY_RPC_WINDOW_STICK, UnityPlatformStickWindow },
95
{ UNITY_RPC_WINDOW_UNSTICK, UnityPlatformUnstickWindow },
96
/* Add more commands and handlers above this. */
101
* A list of the commands implemented in this library - this list should
102
* match the command dispatch table.
104
static char* unityCommandList[] = {
105
UNITY_RPC_WINDOW_CLOSE,
106
UNITY_RPC_WINDOW_SHOW,
107
UNITY_RPC_WINDOW_HIDE,
108
UNITY_RPC_WINDOW_MINIMIZE,
109
UNITY_RPC_WINDOW_UNMINIMIZE,
110
UNITY_RPC_WINDOW_MAXIMIZE,
111
UNITY_RPC_WINDOW_UNMAXIMIZE,
112
UNITY_RPC_WINDOW_STICK,
113
UNITY_RPC_WINDOW_UNSTICK,
114
/* Add more commands above this. */
120
void (*setter)(Bool enabled);
121
} UnityFeatureSetter;
124
* Dispatch table for each unity option and a specific function to handle enabling
125
* or disabling the option. The function is called with an enable (TRUE) bool value.
127
static UnityFeatureSetter unityFeatureTable[] = {
128
{ UNITY_ADD_HIDDEN_WINDOWS_TO_TRACKER, UnitySetAddHiddenWindows },
129
{ UNITY_INTERLOCK_MINIMIZE_OPERATION, UnitySetInterlockMinimizeOperation },
130
{ UNITY_SEND_WINDOW_CONTENTS, UnitySetSendWindowContents },
131
{ UNITY_DISABLE_COMPOSITING_IN_GUEST, UnitySetDisableCompositing },
132
/* Add more Unity Feature Setters above this. */
138
*----------------------------------------------------------------------------
140
* Unity_IsSupported --
142
* Determine whether this guest supports unity.
145
* TRUE if the guest supports Unity (i.e. if the guest is WinXP) or
146
* if the option to always enable unity was specified in the tools
153
*----------------------------------------------------------------------------
157
Unity_IsSupported(void)
159
return UnityPlatformIsSupported() || unity.forceEnable;
164
*----------------------------------------------------------------------------
168
* Determine whether we are in Unity mode at this moment.
171
* TRUE if Unity is active.
172
* FALSE is Unity is not active.
177
*----------------------------------------------------------------------------
183
return unity.isEnabled;
188
*-----------------------------------------------------------------------------
192
* One time initialization stuff.
199
* May register with the tools poll loop.
201
*-----------------------------------------------------------------------------
205
Unity_Init(GuestApp_Dict *conf, // IN
206
UnityHostCallbacks hostCallbacks, // IN
207
gpointer serviceObj) // IN
209
Debug("Unity_Init\n");
211
ASSERT(hostCallbacks.updateCB);
212
ASSERT(hostCallbacks.buildUpdateCB);
213
ASSERT(hostCallbacks.sendWindowContents);
214
ASSERT(hostCallbacks.sendRequestMinimizeOperation);
215
ASSERT(hostCallbacks.shouldShowTaskbar);
217
unity.hostCallbacks = hostCallbacks;
220
* Initialize the UnityWindowTracker object. The uwt does all the actual work
221
* of computing differences between two states of the windowing system. The
222
* callbacks we register here will fire when we request an update via
223
* UnityWindowTracker_RequestUpdates. See bora/lib/unityWindowTracker for more
226
UnityWindowTracker_Init(&unity.tracker, UnityUpdateCallbackFn);
230
* Initialize the platform-specific portion of the unity service.
232
unity.up = UnityPlatformInit(&unity.tracker,
233
unity.hostCallbacks);
235
unity.virtDesktopArray.desktopCount = 0;
238
* Cache the service object and use it to create the enter/exit Unity signal.
240
unity.serviceObj = serviceObj;
241
g_signal_new(UNITY_SIG_ENTER_LEAVE_UNITY,
242
G_OBJECT_TYPE(serviceObj),
247
g_cclosure_marshal_VOID__BOOLEAN,
255
*-----------------------------------------------------------------------------
259
* Exit Unity and do final cleanup.
267
*-----------------------------------------------------------------------------
275
Debug("%s\n", __FUNCTION__);
283
unity.serviceObj = NULL;
286
* Do one-time final platform-specific cleanup.
291
UnityPlatformCleanup(up);
293
UnityWindowTracker_Cleanup(&unity.tracker);
298
*-----------------------------------------------------------------------------
300
* Unity_SetActiveDnDDetWnd --
302
* Right now we have 2 Unity DnD full screen detection window, one for version
303
* 2 or older, another for version 3 or newer. This function is to set active
304
* one according to host DnD version.
306
* XXX Both full-screent window is still bottom-most and is showed all time
307
* during Unity mode. Another change is needed to change it to only show the
308
* window during guest->host DnD. Also the window should not be bottom-most,
309
* but dynamicly change z-order during DnD.
317
*-----------------------------------------------------------------------------
321
Unity_SetActiveDnDDetWnd(UnityDnD *state)
323
if (unity.up != NULL) {
324
UnityPlatformSetActiveDnDDetWnd(unity.up, state);
330
*-----------------------------------------------------------------------------
334
* Called everytime we exit Unity. This function can be called when we are
335
* not in Unity mode. Right now it is called every time a 'reset' TCLO command
336
* is sent to the guest. Therefore, there's no guarantee that we were in the
337
* Unity mode when this function is called.
339
* Try to do the following:
340
* Restore system settings if needed.
341
* Hide the unity dnd detection window.
347
* Restores system settings since we are exiting Unity.
348
* Hides the unity dnd detection window if needed.
349
* Sets unity.isEnabled to FALSE
351
*-----------------------------------------------------------------------------
357
int featureIndex = 0;
359
if (unity.isEnabled) {
361
* Reset any Unity Options - they'll be re-enabled as required before the
362
* next UnityTcloEnter.
364
while (unityFeatureTable[featureIndex].featureBit != 0) {
365
if (unity.currentOptions & unityFeatureTable[featureIndex].featureBit) {
366
unityFeatureTable[featureIndex].setter(FALSE);
370
unity.currentOptions = 0;
372
/* Hide full-screen detection window for Unity DnD. */
373
UnityPlatformUpdateDnDDetWnd(unity.up, FALSE);
375
UnityPlatformExitUnity(unity.up);
377
/* Restore previously saved user settings. */
378
UnityPlatformRestoreSystemSettings(unity.up);
380
unity.isEnabled = FALSE;
381
FireEnterUnitySignal(unity.serviceObj, FALSE);
387
*-----------------------------------------------------------------------------
391
* Called everytime we enter Unity.
393
* Try to do the following:
394
* Save the system settings.
395
* Show the unity dnd detection window.
398
* TRUE if Unity was entered.
401
* Sets unity.isEnabled to TRUE.
403
*-----------------------------------------------------------------------------
409
if (!unity.isEnabled) {
410
/* Save and disable certain user settings here. */
411
UnityPlatformSaveSystemSettings(unity.up);
413
if (!UnityPlatformEnterUnity(unity.up)) {
414
UnityPlatformExitUnity(unity.up);
415
UnityPlatformRestoreSystemSettings(unity.up);
420
* Show full-screen detection window for Unity DnD. It is a bottom-most (but
421
* still in front of desktop) transparent detection window for guest->host DnD
422
* as drop target. We need this window because:
423
* 1. All active windows except desktop will be shown on host desktop and can
424
* accept DnD signal. This full-screen detection window will block any DnD signal
425
* (even mouse signal) to the desktop, which will fix bug 164880.
426
* 2. With this full-screen but bottommost detection window, every time when user
427
* drag something out from active window, the dragEnter will always be immediately
428
* catched for Unity DnD.
430
UnityPlatformUpdateDnDDetWnd(unity.up, TRUE);
431
FireEnterUnitySignal(unity.serviceObj, TRUE);
432
unity.isEnabled = TRUE;
439
*----------------------------------------------------------------------------
441
* Unity_GetWindowCommandList --
443
* Retrieve the list of command strings supported by this library. The
444
* commands are a list of strings which each operate on a specified Unity
445
* window ID to perform operations like unmiminimize or restore.
453
*----------------------------------------------------------------------------
457
Unity_GetWindowCommandList(char ***commandList) // OUT
459
ASSERT(commandList != NULL);
461
*commandList = unityCommandList;
466
*----------------------------------------------------------------------------
468
* Unity_GetWindowPath --
470
* Get the information needed to re-launch a window and retrieve further information
471
* on it. windowPathUtf8 and execPathUtf8 allow a platform to specify different
472
* null terminated strings for the 'path' to the window vs. the path to the
473
* executable that launched the window. The exact meaning of the buffer contents
474
* is platform-specific.
477
* TRUE if everything is successful.
483
*----------------------------------------------------------------------------
487
Unity_GetWindowPath(UnityWindowId window, // IN: window handle
488
DynBuf *windowPathUtf8, // IN/OUT: full path for the window
489
DynBuf *execPathUtf8) // IN/OUT: full path for the executable
491
return UnityPlatformGetWindowPath(unity.up, window, windowPathUtf8, execPathUtf8);
496
*----------------------------------------------------------------------------
498
* Unity_WindowCommand --
500
* Execute the specified command for the given window ID.
503
* TRUE if everything is successful.
509
*----------------------------------------------------------------------------
513
Unity_WindowCommand(UnityWindowId window, // IN: window handle
514
const char *command) // IN: Command name
519
for (i = 0; unityCommandTable[i].name != NULL; i++) {
520
if (strcmp(unityCommandTable[i].name, command) == 0) {
521
if (!unityCommandTable[i].exec(unity.up, window)) {
522
Debug("%s: Unity window command %s failed.\n", __FUNCTION__, command);
530
Debug("%s: Invalid command %s\n", __FUNCTION__, command);
536
*----------------------------------------------------------------------------
538
* Unity_SetDesktopWorkAreas --
540
* Sets the work areas for all screens. These are the areas
541
* to which windows will maximize.
544
* TRUE if everything is successful.
550
*----------------------------------------------------------------------------
554
Unity_SetDesktopWorkAreas(UnityRect workAreas[], // IN
555
uint32 numWorkAreas) // IN
559
for (i = 0; i < numWorkAreas; i++) {
560
if (workAreas[i].x < 0 || workAreas[i].y < 0 ||
561
workAreas[i].width <= 0 || workAreas[i].height <= 0) {
562
Debug("%s: Invalid work area\n", __FUNCTION__);
567
return UnityPlatformSetDesktopWorkAreas(unity.up, workAreas, numWorkAreas);
572
*----------------------------------------------------------------------------
574
* Unity_SetTopWindowGroup --
576
* Set the group of windows on top of all others.
579
* TRUE if everything is successful.
585
*----------------------------------------------------------------------------
589
Unity_SetTopWindowGroup(UnityWindowId windows[], // IN: array of window ids
590
unsigned int windowCount) // IN: # of windows in the array
592
return UnityPlatformSetTopWindowGroup(unity.up, windows, windowCount);
597
*----------------------------------------------------------------------------
601
* This function is used to asynchronously collect Unity window updates
602
* and send them to the host via the guest->host channel.
610
*----------------------------------------------------------------------------
614
Unity_GetUpdate(Bool incremental) // IN: Incremental vs. full update
616
UnityPlatformDoUpdate(unity.up, incremental);
621
*----------------------------------------------------------------------------
623
* Unity_ConfirmOperation --
625
* Confirmation from the host that an operation requiring interlock has been
626
* completed by the host.
629
* TRUE if the confirmation could be handled sucessfully.
635
*----------------------------------------------------------------------------
639
Unity_ConfirmOperation(unsigned int operation, // IN
640
UnityWindowId windowId, // IN
641
uint32 sequence, // IN
646
if (MINIMIZE == operation) {
647
retVal = UnityPlatformConfirmMinimizeOperation(unity.up,
652
Debug("%s: Confirmation for unknown operation ID = %d\n", __FUNCTION__, operation);
659
*----------------------------------------------------------------------------
661
* Unity_SendMouseWheel --
663
* Sends the given mouse wheel event to the window at the given location.
666
* TRUE on success, FALSE on failure.
671
*----------------------------------------------------------------------------
675
Unity_SendMouseWheel(int32 deltaX, // IN
678
uint32 modifierFlags) // IN
680
return UnityPlatformSendMouseWheel(unity.up, deltaX, deltaY, deltaZ, modifierFlags);
685
*----------------------------------------------------------------------------
687
* Unity_GetUpdates --
689
* Get the unity window update and append it to the specified output buffer.
690
* This function can be called from two different threads: either from
691
* the main thread that is trying to execute a TCLO command (unity.get.update)
692
* or from the unity update thread that is gathering periodic updates and
693
* pushes them to the VMX as needed (by calling 'tools.unity.push.update RPC).
694
* Since this function can be called from two different threads, protect
695
* the global unity singleton with locks.
703
*----------------------------------------------------------------------------
707
Unity_GetUpdates(int flags) // IN: unity update flags
709
UnityPlatformLock(unity.up);
712
* Generate the update stream. This will cause our UnityUpdateCallbackFn to be
713
* triggered, which will in turn lead to the callback registered with the
714
* 'consumer' of this library which will do the actual update serialization.
716
UnityWindowTracker_RequestUpdates(&unity.tracker, flags, unity.up);
718
UnityPlatformUnlock(unity.up);
725
*----------------------------------------------------------------------------
727
* UnityUpdateCallbackFn --
729
* Callback from the unity window tracker indicating something has
732
* Perform any internal functions we need called as a consequence of tracker
733
* window state changing and then call the provided callback to serialize the
742
*----------------------------------------------------------------------------
746
UnityUpdateCallbackFn(void *param, // IN: UnityPlatform
747
UnityUpdate *update) // IN
749
unity.hostCallbacks.updateCB(unity.hostCallbacks.updateCbCtx, update);
754
*----------------------------------------------------------------------------
756
* Unity_GetWindowContents --
758
* Read the correct bits off the window regardless of whether it's minimized
759
* or obscured. Return the result as a PNG in the imageData DynBuf.
762
* TRUE if everything is successful.
764
* imageData contains PNG formatted window contents.
769
*----------------------------------------------------------------------------
773
Unity_GetWindowContents(UnityWindowId window, // IN
774
DynBuf *imageData, // IN/OUT
775
uint32 *width, // OUT
776
uint32 *height) // OUT
778
return UnityPlatformGetWindowContents(unity.up, window, imageData, width, height);
783
*----------------------------------------------------------------------------
785
* Unity_GetIconData --
787
* Read part or all of a particular icon on a window. Return the result as a PNG in
788
* the imageData DynBuf, and also return the full length of the PNG in fullLength.
791
* TRUE if everything is successful.
797
*----------------------------------------------------------------------------
801
Unity_GetIconData(UnityWindowId window, // IN
802
UnityIconType iconType, // IN
803
UnityIconSize iconSize, // IN
804
uint32 dataOffset, // IN
805
uint32 dataLength, // IN
806
DynBuf *imageData, // OUT
807
uint32 *fullLength) // OUT
809
return UnityPlatformGetIconData(unity.up, window, iconType, iconSize,
810
dataOffset, dataLength, imageData, fullLength);
815
*----------------------------------------------------------------------------
817
* Unity_ShowTaskbar --
819
* Show/hide the taskbar while in Unity mode.
827
*----------------------------------------------------------------------------
831
Unity_ShowTaskbar(Bool showTaskbar) // IN
833
UnityPlatformShowTaskbar(unity.up, showTaskbar);
838
*-----------------------------------------------------------------------------
840
* Unity_ShowDesktop --
842
* Shows or hides the entire VM desktop while in unity. This is useful for
843
* situations where the user must interact with a window that we cannot
844
* control programmatically, such as UAC prompts on Vista and Win7.
852
*-----------------------------------------------------------------------------
856
Unity_ShowDesktop(Bool showDesktop) // IN
858
UnityPlatformShowDesktop(unity.up, showDesktop);
863
*----------------------------------------------------------------------------
865
* Unity_MoveResizeWindow --
867
* Moves and/or resizes the given window to the specified location. Does not
868
* attempt to move and/or resize window if (a) the destination rectangle does not
869
* intersect with the virtual screen rectangle, or (b) window is minimized.
871
* If the input width & height match the current width & height, then this
872
* function will end up just moving the window. Similarly if the input
873
* x & y coordinates match the current coordinates, then it will end up just
874
* resizing the window.
877
* Even if the move/resize operation is not executed or it fails, window's
878
* current coordinates are always sent back.
880
* Function does not return FALSE if the attempt to move and/or resize fails.
881
* This is because the caller will be comparing input and output parameters to
882
* decide whether the window really moved and/or resized.
884
* In a very rare case, when attempt to get window's current coordinates fail,
890
*----------------------------------------------------------------------------
894
Unity_MoveResizeWindow(UnityWindowId window, // IN: Window handle
895
UnityRect *moveResizeRect) // IN/OUT: Desired coordinates,
896
// before and after the operation.
898
return UnityPlatformMoveResizeWindow(unity.up, window, moveResizeRect);
903
*----------------------------------------------------------------------------
905
* Unity_SetDesktopConfig --
907
* Set the virtual desktop configuration as specified by the host.
910
* TRUE if everything is successful.
916
*----------------------------------------------------------------------------
920
Unity_SetDesktopConfig(const UnityVirtualDesktopArray *desktopConfig) // IN
922
if (UnityPlatformSetDesktopConfig(unity.up, desktopConfig)) {
923
unity.virtDesktopArray = *desktopConfig;
931
*----------------------------------------------------------------------------
933
* Unity_SetDesktopActive --
935
* Switch to the specified virtual desktop.
938
* TRUE if everything is successful.
942
* Might change the active virtual desktop in the guest.
944
*----------------------------------------------------------------------------
948
Unity_SetDesktopActive(UnityDesktopId desktopId) // IN: Index into desktop config. array
950
if (desktopId >= unity.virtDesktopArray.desktopCount) {
951
Debug("%s: Desktop (%d) does not exist in the guest", __FUNCTION__, desktopId);
955
return UnityPlatformSetDesktopActive(unity.up, desktopId);
960
*----------------------------------------------------------------------------
962
* Unity_SetWindowDesktop --
964
* Move the window to the specified desktop. The desktopId is an index
965
* into the desktop configuration array.
968
* TRUE if everything is successful.
972
* Might change the active virtual desktop in the guest.
974
*----------------------------------------------------------------------------
978
Unity_SetWindowDesktop(UnityWindowId windowId, // IN
979
UnityDesktopId desktopId) // IN
981
if (desktopId >= unity.virtDesktopArray.desktopCount) {
982
Debug("%s: The desktop (%d) does not exist in the guest", __FUNCTION__, desktopId);
987
* Set the desktop id for this window in the tracker.
988
* We need to do this before moving the window since on MS Windows platforms
989
* moving the window will hide it and there's a danger that we may enumerate the
990
* hidden window before changing it's desktop ID. The Window tracker will ignore
991
* hidden windows on the current desktop - which ultimately can lead to this window
992
* being reaped from the tracker.
994
UnityWindowTracker_ChangeWindowDesktop(&unity.tracker, windowId, desktopId);
996
return UnityPlatformSetWindowDesktop(unity.up, windowId, desktopId);
1001
*----------------------------------------------------------------------------
1003
* Unity_SetUnityOptions --
1005
* Set the Unity options - must be be called before entering Unity mode.
1006
* UnityFeatures is a bitmask of features to be enabled (see unityCommon.h)
1014
*----------------------------------------------------------------------------
1018
Unity_SetUnityOptions(uint32 newFeaturesMask) // IN: UnityFeatures
1020
int featureIndex = 0;
1021
uint32 featuresChanged;
1023
if (unity.isEnabled) {
1024
Debug("%s: Attempting to set unity options whilst unity is enabled\n",
1029
* For each potential feature bit XOR the current mask with the newly
1030
* specified set, then if the bit has changed call the specific setter
1031
* function with TRUE/FALSE according to the new state of the bit.
1033
featuresChanged = newFeaturesMask ^ unity.currentOptions;
1034
while (unityFeatureTable[featureIndex].featureBit != 0) {
1035
if (featuresChanged & unityFeatureTable[featureIndex].featureBit) {
1036
unityFeatureTable[featureIndex].setter(
1037
(newFeaturesMask & unityFeatureTable[featureIndex].featureBit) != 0);
1042
unity.currentOptions = newFeaturesMask;
1047
*----------------------------------------------------------------------------
1049
* Unity_RequestWindowContents --
1051
* Add the requeste window IDs to a list of windows whose contents should
1052
* be sent to the host. See also hostcallbacks.sendWindowContents().
1055
* TRUE if all the window IDs are valid.
1061
*----------------------------------------------------------------------------
1065
Unity_RequestWindowContents(UnityWindowId windowIds[], // IN
1066
uint32 numWindowIds) // IN)
1068
return UnityPlatformRequestWindowContents(unity.up, windowIds, numWindowIds);
1073
*----------------------------------------------------------------------------
1075
* UnitySetAddHiddenWindows --
1077
* Set (or unset) whether hidden windows should be added to the tracker.
1085
*----------------------------------------------------------------------------
1089
UnitySetAddHiddenWindows(Bool enabled)
1092
* Should we add hidden windows to the tracker (the host will use the trackers
1093
* attribute field to display hidden windows in the appropriate manner.)
1096
Debug("%s: Adding hidden windows to tracker\n", __FUNCTION__);
1098
Debug("%s: Do not add hidden windows to tracker\n", __FUNCTION__);
1104
*----------------------------------------------------------------------------
1106
* UnitySetInterlockMinimizeOperation --
1108
* Set (or unset) whether window operations should be denied/delayed and
1109
* relayed to the host for later confirmation.
1117
*----------------------------------------------------------------------------
1121
UnitySetInterlockMinimizeOperation(Bool enabled)
1124
* Should we interlock operations through the host. For example: instead of
1125
* allowing minimize to occur immediately in the guest should we prevent the
1126
* minimize of a window in the guest, then relay the minimize to the host and wait
1127
* for the hosts confirmation before actually minimizing the window in the guest.
1130
Debug("%s: Interlocking minimize operations through the host\n",
1133
Debug("%s: Do not interlock minimize operations through the host\n",
1136
UnityPlatformSetInterlockMinimizeOperation(unity.up, enabled);
1141
*----------------------------------------------------------------------------
1143
* UnitySetSendWindowContents --
1145
* Set (or unset) whether window contents should be sent to the host.
1153
*----------------------------------------------------------------------------
1157
UnitySetSendWindowContents(Bool enabled)
1160
* Is the host prepared to receive scraped window contents at any time - even though
1161
* it may not have previously requested the window contents. Explicit requests from
1162
* the host will always be honored - this flag determines whether the guest will send
1163
* the window contents directly after a qualifying operation (like changes in the
1164
* z-order of a window).
1167
Debug("%s: Sending window contents to the host on appropriate events\n",
1170
Debug("%s: Do not send window contents to the host on appropriate events\n",
1177
*----------------------------------------------------------------------------
1179
* UnitySetDisableCompositing --
1181
* Set (or unset) whether the compositing features of the guest window
1182
* manager should be disabled.
1190
*----------------------------------------------------------------------------
1194
UnitySetDisableCompositing(Bool disabled)
1197
* Does the host wish us to disable the compositing features of the guest window
1198
* manager. The flag only takes effect on subsequent 'enter unity' calls where
1199
* it is checked and used to disable compositing in the platform layer.
1202
Debug("%s: Window compositing will be disabled in the guest window manager.\n",
1205
Debug("%s: Window compositing will be enabled in the guest window manager.\n",
1208
UnityPlatformSetDisableCompositing(unity.up, disabled);
1213
*-----------------------------------------------------------------------------
1215
* Unity_SetConfigDesktopColor --
1217
* Set the preferred desktop background color for use when in Unity Mode. Only
1218
* takes effect the next time unity mode is entered.
1226
*-----------------------------------------------------------------------------
1230
Unity_SetConfigDesktopColor(int desktopColor) // IN
1232
UnityPlatformSetConfigDesktopColor(unity.up, desktopColor);
1237
*------------------------------------------------------------------------------
1239
* Unity_SetInitialDesktop --
1241
* Set a desktop specified by the desktop id as the initial state.
1244
* Returns TRUE if successful, and FALSE otherwise.
1249
*------------------------------------------------------------------------------
1253
Unity_SetInitialDesktop(UnityDesktopId desktopId) // IN
1255
return UnityPlatformSetInitialDesktop(unity.up, desktopId);
1260
*-----------------------------------------------------------------------------
1262
* Unity_SetForceEnable --
1264
* Set's the flag to indicate that Unity should be forced to be enabled, rather
1265
* than relying on runtime determination of the state of other dependancies.
1273
*-----------------------------------------------------------------------------
1277
Unity_SetForceEnable(Bool forceEnable) // IN
1279
unity.forceEnable = forceEnable;
1284
*-----------------------------------------------------------------------------
1286
* Unity_InitializeDebugger --
1288
* Initialize the Unity Debugger. This is a graphical display inside the guest
1289
* used to visualize the current state of the unity window tracker.
1297
*-----------------------------------------------------------------------------
1301
Unity_InitializeDebugger(void)
1303
UnityDebug_Init(&unity.tracker);
1308
* Fire signal to broadcast when unity is entered and exited.
1310
* @param[in] ctx tools application context
1311
* @param[in] enter if TRUE, unity was entered. If FALSE, unity has exited.
1315
FireEnterUnitySignal(gpointer serviceObj,
1318
Debug("%s: enter. enter argument is set to %s\n", __FUNCTION__, enter ? "true" : "false");
1319
g_signal_emit_by_name(serviceObj,
1320
UNITY_SIG_ENTER_LEAVE_UNITY,