* ServerApp now maintains a mask of workspaces with temporary mode settings,
and reverts the modes if the app goes away (ie. if it crashes). * Desktop::SetScreenMode() also set the mode on the current screen, even if it should have been set on another screen. * Cleaned up the Desktop.h header. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32564 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+70
-16
@@ -931,6 +931,23 @@ Desktop::SetWorkspace(int32 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Desktop::_SetCurrentWorkspaceConfiguration()
|
||||||
|
{
|
||||||
|
ASSERT_MULTI_WRITE_LOCKED(fWindowLock);
|
||||||
|
|
||||||
|
uint32 changedScreens;
|
||||||
|
fVirtualScreen.SetConfiguration(*this,
|
||||||
|
fWorkspaces[fCurrentWorkspace].CurrentScreenConfiguration(),
|
||||||
|
&changedScreens);
|
||||||
|
|
||||||
|
for (int32 i = 0; changedScreens != 0; i++, changedScreens /= 2) {
|
||||||
|
if ((changedScreens & (1 << i)) != 0)
|
||||||
|
ScreenChanged(fVirtualScreen.ScreenAt(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! Changes the current workspace to the one specified by \a index.
|
/*! Changes the current workspace to the one specified by \a index.
|
||||||
You must hold the all window lock when calling this method.
|
You must hold the all window lock when calling this method.
|
||||||
*/
|
*/
|
||||||
@@ -998,15 +1015,7 @@ Desktop::_SetWorkspace(int32 index)
|
|||||||
fCurrentWorkspace = index;
|
fCurrentWorkspace = index;
|
||||||
|
|
||||||
// Change the display modes, if needed
|
// Change the display modes, if needed
|
||||||
|
_SetCurrentWorkspaceConfiguration();
|
||||||
uint32 changedScreens;
|
|
||||||
fVirtualScreen.SetConfiguration(*this,
|
|
||||||
fWorkspaces[index].CurrentScreenConfiguration(), &changedScreens);
|
|
||||||
|
|
||||||
for (int32 i = 0; changedScreens != 0; i++, changedScreens /= 2) {
|
|
||||||
if ((changedScreens & (1 << i)) != 0)
|
|
||||||
ScreenChanged(fVirtualScreen.ScreenAt(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show windows, and include them in the changed region - but only
|
// Show windows, and include them in the changed region - but only
|
||||||
// those that were not visible before (or whose position changed)
|
// those that were not visible before (or whose position changed)
|
||||||
@@ -1143,6 +1152,12 @@ Desktop::SetScreenMode(int32 workspace, int32 id, const display_mode& mode,
|
|||||||
|
|
||||||
if (!memcmp(&oldMode, &mode, sizeof(display_mode)))
|
if (!memcmp(&oldMode, &mode, sizeof(display_mode)))
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
|
// Set the new one
|
||||||
|
|
||||||
|
status_t status = screen->SetMode(mode);
|
||||||
|
if (status != B_OK)
|
||||||
|
return status;
|
||||||
} else {
|
} else {
|
||||||
// retrieve from settings
|
// retrieve from settings
|
||||||
screen_configuration* configuration
|
screen_configuration* configuration
|
||||||
@@ -1153,12 +1168,6 @@ Desktop::SetScreenMode(int32 workspace, int32 id, const display_mode& mode,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the new one
|
|
||||||
|
|
||||||
status_t status = screen->SetMode(mode);
|
|
||||||
if (status != B_OK)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
// Update our configurations
|
// Update our configurations
|
||||||
|
|
||||||
monitor_info info;
|
monitor_info info;
|
||||||
@@ -1241,10 +1250,55 @@ Desktop::GetScreenFrame(int32 workspace, int32 id, BRect& frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Desktop::RevertScreenModes(uint32 workspaces)
|
||||||
|
{
|
||||||
|
if (workspaces == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AutoWriteLocker _(fWindowLock);
|
||||||
|
|
||||||
|
for (int32 workspace = 0; workspace < kMaxWorkspaces; workspace++) {
|
||||||
|
if ((workspaces & (1U << workspace)) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Revert all screens on this workspace
|
||||||
|
|
||||||
|
// TODO: ideally, we would know which screens to revert - this way, too
|
||||||
|
// many of them could be reverted
|
||||||
|
|
||||||
|
for (int32 index = 0; index < fVirtualScreen.CountScreens(); index++) {
|
||||||
|
Screen* screen = fVirtualScreen.ScreenAt(index);
|
||||||
|
|
||||||
|
// retrieve configurations
|
||||||
|
screen_configuration* stored = fWorkspaces[workspace]
|
||||||
|
.StoredScreenConfiguration().CurrentByID(screen->ID());
|
||||||
|
screen_configuration* current = fWorkspaces[workspace]
|
||||||
|
.CurrentScreenConfiguration().CurrentByID(screen->ID());
|
||||||
|
|
||||||
|
if ((stored != NULL && current != NULL
|
||||||
|
&& !memcmp(&stored->mode, ¤t->mode,
|
||||||
|
sizeof(display_mode)))
|
||||||
|
|| (stored == NULL && current == NULL))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (stored == NULL) {
|
||||||
|
fWorkspaces[workspace].CurrentScreenConfiguration()
|
||||||
|
.Remove(current);
|
||||||
|
|
||||||
|
if (workspace == fCurrentWorkspace)
|
||||||
|
_SetCurrentWorkspaceConfiguration();
|
||||||
|
} else
|
||||||
|
SetScreenMode(workspace, screen->ID(), stored->mode, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Desktop::ScreenChanged(Screen* screen)
|
Desktop::ScreenChanged(Screen* screen)
|
||||||
{
|
{
|
||||||
ASSERT(fWindowLock.IsWriteLocked());
|
ASSERT_MULTI_WRITE_LOCKED(fWindowLock);
|
||||||
|
|
||||||
// the entire screen is dirty, because we're actually
|
// the entire screen is dirty, because we're actually
|
||||||
// operating on an all new buffer in memory
|
// operating on an all new buffer in memory
|
||||||
|
|||||||
+159
-156
@@ -58,282 +58,285 @@ namespace BPrivate {
|
|||||||
|
|
||||||
|
|
||||||
class Desktop : public MessageLooper, public ScreenOwner {
|
class Desktop : public MessageLooper, public ScreenOwner {
|
||||||
public:
|
public:
|
||||||
Desktop(uid_t userID);
|
Desktop(uid_t userID);
|
||||||
virtual ~Desktop();
|
virtual ~Desktop();
|
||||||
|
|
||||||
status_t Init();
|
status_t Init();
|
||||||
|
|
||||||
uid_t UserID() const { return fUserID; }
|
uid_t UserID() const { return fUserID; }
|
||||||
virtual port_id MessagePort() const { return fMessagePort; }
|
virtual port_id MessagePort() const { return fMessagePort; }
|
||||||
area_id SharedReadOnlyArea() const
|
area_id SharedReadOnlyArea() const
|
||||||
{ return fSharedReadOnlyArea; }
|
{ return fSharedReadOnlyArea; }
|
||||||
|
|
||||||
::EventDispatcher& EventDispatcher() { return fEventDispatcher; }
|
::EventDispatcher& EventDispatcher() { return fEventDispatcher; }
|
||||||
|
|
||||||
void BroadcastToAllApps(int32 code);
|
void BroadcastToAllApps(int32 code);
|
||||||
void BroadcastToAllWindows(int32 code);
|
void BroadcastToAllWindows(int32 code);
|
||||||
|
|
||||||
// Mouse and cursor methods
|
// Mouse and cursor methods
|
||||||
|
|
||||||
void SetCursor(ServerCursor* cursor);
|
void SetCursor(ServerCursor* cursor);
|
||||||
ServerCursorReference Cursor() const;
|
ServerCursorReference Cursor() const;
|
||||||
void SetLastMouseState(const BPoint& position,
|
void SetLastMouseState(const BPoint& position,
|
||||||
int32 buttons, Window* windowUnderMouse);
|
int32 buttons, Window* windowUnderMouse);
|
||||||
// for use by the mouse filter only
|
// for use by the mouse filter only
|
||||||
// both mouse position calls require
|
// both mouse position calls require
|
||||||
// the Desktop object to be locked
|
// the Desktop object to be locked
|
||||||
// already
|
// already
|
||||||
void GetLastMouseState(BPoint* position,
|
void GetLastMouseState(BPoint* position,
|
||||||
int32* buttons) const;
|
int32* buttons) const;
|
||||||
// for use by ServerWindow
|
// for use by ServerWindow
|
||||||
|
|
||||||
// Screen and drawing related methods
|
// Screen and drawing related methods
|
||||||
|
|
||||||
Screen* ScreenAt(int32 index) const
|
Screen* ScreenAt(int32 index) const
|
||||||
{ return fActiveScreen; }
|
{ return fActiveScreen; }
|
||||||
Screen* ActiveScreen() const
|
Screen* ActiveScreen() const
|
||||||
{ return fActiveScreen; }
|
{ return fActiveScreen; }
|
||||||
|
|
||||||
CursorManager& GetCursorManager() { return fCursorManager; }
|
CursorManager& GetCursorManager() { return fCursorManager; }
|
||||||
|
|
||||||
status_t SetScreenMode(int32 workspace, int32 id,
|
status_t SetScreenMode(int32 workspace, int32 id,
|
||||||
const display_mode& mode, bool makeDefault);
|
const display_mode& mode, bool makeDefault);
|
||||||
status_t GetScreenMode(int32 workspace, int32 id,
|
status_t GetScreenMode(int32 workspace, int32 id,
|
||||||
display_mode& mode);
|
display_mode& mode);
|
||||||
status_t GetScreenFrame(int32 workspace, int32 id,
|
status_t GetScreenFrame(int32 workspace, int32 id,
|
||||||
BRect& frame);
|
BRect& frame);
|
||||||
|
void RevertScreenModes(uint32 workspaces);
|
||||||
|
|
||||||
void ScreenChanged(Screen* screen);
|
void ScreenChanged(Screen* screen);
|
||||||
|
|
||||||
const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; }
|
const ::VirtualScreen& VirtualScreen() const
|
||||||
DrawingEngine* GetDrawingEngine() const
|
{ return fVirtualScreen; }
|
||||||
|
DrawingEngine* GetDrawingEngine() const
|
||||||
{ return fVirtualScreen.DrawingEngine(); }
|
{ return fVirtualScreen.DrawingEngine(); }
|
||||||
::HWInterface* HWInterface() const
|
::HWInterface* HWInterface() const
|
||||||
{ return fVirtualScreen.HWInterface(); }
|
{ return fVirtualScreen.HWInterface(); }
|
||||||
|
|
||||||
// ScreenOwner implementation
|
// ScreenOwner implementation
|
||||||
void ScreenRemoved(Screen* screen) {}
|
virtual void ScreenRemoved(Screen* screen) {}
|
||||||
void ScreenAdded(Screen* screen) {}
|
virtual void ScreenAdded(Screen* screen) {}
|
||||||
bool ReleaseScreen(Screen* screen) { return false; }
|
virtual bool ReleaseScreen(Screen* screen) { return false; }
|
||||||
|
|
||||||
// Workspace methods
|
// Workspace methods
|
||||||
|
|
||||||
void SetWorkspaceAsync(int32 index);
|
void SetWorkspaceAsync(int32 index);
|
||||||
void SetWorkspace(int32 index);
|
void SetWorkspace(int32 index);
|
||||||
int32 CurrentWorkspace()
|
int32 CurrentWorkspace()
|
||||||
{ return fCurrentWorkspace; }
|
{ return fCurrentWorkspace; }
|
||||||
Workspace::Private& WorkspaceAt(int32 index)
|
Workspace::Private& WorkspaceAt(int32 index)
|
||||||
{ return fWorkspaces[index]; }
|
{ return fWorkspaces[index]; }
|
||||||
status_t SetWorkspacesLayout(int32 columns, int32 rows);
|
status_t SetWorkspacesLayout(int32 columns, int32 rows);
|
||||||
BRect WorkspaceFrame(int32 index) const;
|
BRect WorkspaceFrame(int32 index) const;
|
||||||
|
|
||||||
// Window methods
|
// Window methods
|
||||||
|
|
||||||
void ActivateWindow(Window* window);
|
void ActivateWindow(Window* window);
|
||||||
void SendWindowBehind(Window* window,
|
void SendWindowBehind(Window* window,
|
||||||
Window* behindOf = NULL);
|
Window* behindOf = NULL);
|
||||||
|
|
||||||
void ShowWindow(Window* window);
|
void ShowWindow(Window* window);
|
||||||
void HideWindow(Window* window);
|
void HideWindow(Window* window);
|
||||||
|
|
||||||
void MoveWindowBy(Window* window, float x, float y,
|
void MoveWindowBy(Window* window, float x, float y,
|
||||||
int32 workspace = -1);
|
int32 workspace = -1);
|
||||||
void ResizeWindowBy(Window* window, float x,
|
void ResizeWindowBy(Window* window, float x,
|
||||||
float y);
|
float y);
|
||||||
bool SetWindowTabLocation(Window* window,
|
bool SetWindowTabLocation(Window* window,
|
||||||
float location);
|
float location);
|
||||||
bool SetWindowDecoratorSettings(Window* window,
|
bool SetWindowDecoratorSettings(Window* window,
|
||||||
const BMessage& settings);
|
const BMessage& settings);
|
||||||
|
|
||||||
void SetWindowWorkspaces(Window* window,
|
void SetWindowWorkspaces(Window* window,
|
||||||
uint32 workspaces);
|
uint32 workspaces);
|
||||||
|
|
||||||
void AddWindow(Window* window);
|
void AddWindow(Window* window);
|
||||||
void RemoveWindow(Window* window);
|
void RemoveWindow(Window* window);
|
||||||
|
|
||||||
bool AddWindowToSubset(Window* subset,
|
bool AddWindowToSubset(Window* subset,
|
||||||
Window* window);
|
Window* window);
|
||||||
void RemoveWindowFromSubset(Window* subset,
|
void RemoveWindowFromSubset(Window* subset,
|
||||||
Window* window);
|
Window* window);
|
||||||
|
|
||||||
void FontsChanged(Window* window);
|
void FontsChanged(Window* window);
|
||||||
|
|
||||||
void SetWindowLook(Window* window, window_look look);
|
void SetWindowLook(Window* window, window_look look);
|
||||||
void SetWindowFeel(Window* window, window_feel feel);
|
void SetWindowFeel(Window* window, window_feel feel);
|
||||||
void SetWindowFlags(Window* window, uint32 flags);
|
void SetWindowFlags(Window* window, uint32 flags);
|
||||||
void SetWindowTitle(Window* window,
|
void SetWindowTitle(Window* window,
|
||||||
const char* title);
|
const char* title);
|
||||||
|
|
||||||
Window* FocusWindow() const { return fFocus; }
|
Window* FocusWindow() const { return fFocus; }
|
||||||
Window* FrontWindow() const { return fFront; }
|
Window* FrontWindow() const { return fFront; }
|
||||||
Window* BackWindow() const { return fBack; }
|
Window* BackWindow() const { return fBack; }
|
||||||
|
|
||||||
Window* WindowAt(BPoint where);
|
Window* WindowAt(BPoint where);
|
||||||
|
|
||||||
Window* MouseEventWindow() const
|
Window* MouseEventWindow() const
|
||||||
{ return fMouseEventWindow; }
|
{ return fMouseEventWindow; }
|
||||||
void SetMouseEventWindow(Window* window);
|
void SetMouseEventWindow(Window* window);
|
||||||
|
|
||||||
void SetViewUnderMouse(const Window* window,
|
void SetViewUnderMouse(const Window* window,
|
||||||
int32 viewToken);
|
int32 viewToken);
|
||||||
int32 ViewUnderMouse(const Window* window);
|
int32 ViewUnderMouse(const Window* window);
|
||||||
|
|
||||||
void SetFocusWindow(Window* window = NULL);
|
void SetFocusWindow(Window* window = NULL);
|
||||||
EventTarget* KeyboardEventTarget();
|
EventTarget* KeyboardEventTarget();
|
||||||
void SetFocusLocked(const Window* window);
|
void SetFocusLocked(const Window* window);
|
||||||
|
|
||||||
Window* FindWindowByClientToken(int32 token,
|
Window* FindWindowByClientToken(int32 token,
|
||||||
team_id teamID);
|
team_id teamID);
|
||||||
EventTarget* FindTarget(BMessenger& messenger);
|
EventTarget* FindTarget(BMessenger& messenger);
|
||||||
|
|
||||||
#if USE_MULTI_LOCKER
|
#if USE_MULTI_LOCKER
|
||||||
bool LockSingleWindow()
|
bool LockSingleWindow()
|
||||||
{ return fWindowLock.ReadLock(); }
|
{ return fWindowLock.ReadLock(); }
|
||||||
void UnlockSingleWindow()
|
void UnlockSingleWindow()
|
||||||
{ fWindowLock.ReadUnlock(); }
|
{ fWindowLock.ReadUnlock(); }
|
||||||
|
|
||||||
bool LockAllWindows()
|
bool LockAllWindows()
|
||||||
{ return fWindowLock.WriteLock(); }
|
{ return fWindowLock.WriteLock(); }
|
||||||
void UnlockAllWindows()
|
void UnlockAllWindows()
|
||||||
{ fWindowLock.WriteUnlock(); }
|
{ fWindowLock.WriteUnlock(); }
|
||||||
|
|
||||||
MultiLocker WindowLocker() { return fWindowLock; }
|
MultiLocker WindowLocker() { return fWindowLock; }
|
||||||
#else // USE_MULTI_LOCKER
|
#else // USE_MULTI_LOCKER
|
||||||
bool LockSingleWindow()
|
bool LockSingleWindow()
|
||||||
{ return fWindowLock.Lock(); }
|
{ return fWindowLock.Lock(); }
|
||||||
void UnlockSingleWindow()
|
void UnlockSingleWindow()
|
||||||
{ fWindowLock.Unlock(); }
|
{ fWindowLock.Unlock(); }
|
||||||
|
|
||||||
bool LockAllWindows()
|
bool LockAllWindows()
|
||||||
{ return fWindowLock.Lock(); }
|
{ return fWindowLock.Lock(); }
|
||||||
void UnlockAllWindows()
|
void UnlockAllWindows()
|
||||||
{ fWindowLock.Unlock(); }
|
{ fWindowLock.Unlock(); }
|
||||||
#endif // USE_MULTI_LOCKER
|
#endif // USE_MULTI_LOCKER
|
||||||
|
|
||||||
void MarkDirty(BRegion& region);
|
void MarkDirty(BRegion& region);
|
||||||
void Redraw();
|
void Redraw();
|
||||||
|
|
||||||
BRegion& BackgroundRegion()
|
BRegion& BackgroundRegion()
|
||||||
{ return fBackgroundRegion; }
|
{ return fBackgroundRegion; }
|
||||||
|
|
||||||
void RedrawBackground();
|
void RedrawBackground();
|
||||||
void StoreWorkspaceConfiguration(int32 index);
|
void StoreWorkspaceConfiguration(int32 index);
|
||||||
|
|
||||||
void AddWorkspacesView(WorkspacesView* view);
|
void AddWorkspacesView(WorkspacesView* view);
|
||||||
void RemoveWorkspacesView(WorkspacesView* view);
|
void RemoveWorkspacesView(WorkspacesView* view);
|
||||||
|
|
||||||
void MinimizeApplication(team_id team);
|
void MinimizeApplication(team_id team);
|
||||||
void BringApplicationToFront(team_id team);
|
void BringApplicationToFront(team_id team);
|
||||||
void WindowAction(int32 windowToken, int32 action);
|
void WindowAction(int32 windowToken, int32 action);
|
||||||
|
|
||||||
void WriteWindowList(team_id team,
|
void WriteWindowList(team_id team,
|
||||||
BPrivate::LinkSender& sender);
|
BPrivate::LinkSender& sender);
|
||||||
void WriteWindowInfo(int32 serverToken,
|
void WriteWindowInfo(int32 serverToken,
|
||||||
BPrivate::LinkSender& sender);
|
BPrivate::LinkSender& sender);
|
||||||
void WriteApplicationOrder(int32 workspace,
|
void WriteApplicationOrder(int32 workspace,
|
||||||
BPrivate::LinkSender& sender);
|
BPrivate::LinkSender& sender);
|
||||||
void WriteWindowOrder(int32 workspace,
|
void WriteWindowOrder(int32 workspace,
|
||||||
BPrivate::LinkSender& sender);
|
BPrivate::LinkSender& sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _LaunchInputServer();
|
void _LaunchInputServer();
|
||||||
void _SetWorkspace(int32 index);
|
void _SetCurrentWorkspaceConfiguration();
|
||||||
void _ShowWindow(Window* window,
|
void _SetWorkspace(int32 index);
|
||||||
|
void _ShowWindow(Window* window,
|
||||||
bool affectsOtherWindows = true);
|
bool affectsOtherWindows = true);
|
||||||
void _HideWindow(Window* window);
|
void _HideWindow(Window* window);
|
||||||
|
|
||||||
void _UpdateSubsetWorkspaces(Window* window,
|
void _UpdateSubsetWorkspaces(Window* window,
|
||||||
int32 previousIndex = -1,
|
int32 previousIndex = -1,
|
||||||
int32 newIndex = -1);
|
int32 newIndex = -1);
|
||||||
void _ChangeWindowWorkspaces(Window* window,
|
void _ChangeWindowWorkspaces(Window* window,
|
||||||
uint32 oldWorkspaces, uint32 newWorkspaces);
|
uint32 oldWorkspaces, uint32 newWorkspaces);
|
||||||
void _BringWindowsToFront(WindowList& windows,
|
void _BringWindowsToFront(WindowList& windows,
|
||||||
int32 list, bool wereVisible);
|
int32 list, bool wereVisible);
|
||||||
Window* _LastFocusSubsetWindow(Window* window);
|
Window* _LastFocusSubsetWindow(Window* window);
|
||||||
status_t _ActivateApp(team_id team);
|
status_t _ActivateApp(team_id team);
|
||||||
void _SendFakeMouseMoved(Window* window = NULL);
|
void _SendFakeMouseMoved(Window* window = NULL);
|
||||||
|
|
||||||
void _RebuildClippingForAllWindows(
|
void _RebuildClippingForAllWindows(
|
||||||
BRegion& stillAvailableOnScreen);
|
BRegion& stillAvailableOnScreen);
|
||||||
void _TriggerWindowRedrawing(
|
void _TriggerWindowRedrawing(
|
||||||
BRegion& newDirtyRegion);
|
BRegion& newDirtyRegion);
|
||||||
void _SetBackground(BRegion& background);
|
void _SetBackground(BRegion& background);
|
||||||
void _RebuildAndRedrawAfterWindowChange(
|
void _RebuildAndRedrawAfterWindowChange(
|
||||||
Window* window, BRegion& dirty);
|
Window* window, BRegion& dirty);
|
||||||
|
|
||||||
void _UpdateFloating(int32 previousWorkspace = -1,
|
void _UpdateFloating(int32 previousWorkspace = -1,
|
||||||
int32 nextWorkspace = -1,
|
int32 nextWorkspace = -1,
|
||||||
Window* mouseEventWindow = NULL);
|
Window* mouseEventWindow = NULL);
|
||||||
void _UpdateBack();
|
void _UpdateBack();
|
||||||
void _UpdateFront(bool updateFloating = true);
|
void _UpdateFront(bool updateFloating = true);
|
||||||
void _UpdateFronts(bool updateFloating = true);
|
void _UpdateFronts(bool updateFloating = true);
|
||||||
bool _WindowHasModal(Window* window);
|
bool _WindowHasModal(Window* window);
|
||||||
|
|
||||||
void _WindowChanged(Window* window);
|
void _WindowChanged(Window* window);
|
||||||
void _WindowRemoved(Window* window);
|
void _WindowRemoved(Window* window);
|
||||||
|
|
||||||
void _GetLooperName(char* name, size_t size);
|
void _GetLooperName(char* name, size_t size);
|
||||||
void _PrepareQuit();
|
void _PrepareQuit();
|
||||||
void _DispatchMessage(int32 code,
|
void _DispatchMessage(int32 code,
|
||||||
BPrivate::LinkReceiver &link);
|
BPrivate::LinkReceiver &link);
|
||||||
|
|
||||||
WindowList& _CurrentWindows();
|
WindowList& _CurrentWindows();
|
||||||
WindowList& _Windows(int32 index);
|
WindowList& _Windows(int32 index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class DesktopSettings;
|
friend class DesktopSettings;
|
||||||
friend class LockedDesktopSettings;
|
friend class LockedDesktopSettings;
|
||||||
|
|
||||||
uid_t fUserID;
|
uid_t fUserID;
|
||||||
::VirtualScreen fVirtualScreen;
|
::VirtualScreen fVirtualScreen;
|
||||||
DesktopSettingsPrivate* fSettings;
|
DesktopSettingsPrivate* fSettings;
|
||||||
port_id fMessagePort;
|
port_id fMessagePort;
|
||||||
::EventDispatcher fEventDispatcher;
|
::EventDispatcher fEventDispatcher;
|
||||||
port_id fInputPort;
|
port_id fInputPort;
|
||||||
area_id fSharedReadOnlyArea;
|
area_id fSharedReadOnlyArea;
|
||||||
server_read_only_memory* fServerReadOnlyMemory;
|
server_read_only_memory* fServerReadOnlyMemory;
|
||||||
|
|
||||||
BLocker fApplicationsLock;
|
BLocker fApplicationsLock;
|
||||||
BObjectList<ServerApp> fApplications;
|
BObjectList<ServerApp> fApplications;
|
||||||
|
|
||||||
sem_id fShutdownSemaphore;
|
sem_id fShutdownSemaphore;
|
||||||
int32 fShutdownCount;
|
int32 fShutdownCount;
|
||||||
|
|
||||||
::Workspace::Private fWorkspaces[kMaxWorkspaces];
|
::Workspace::Private fWorkspaces[kMaxWorkspaces];
|
||||||
int32 fCurrentWorkspace;
|
int32 fCurrentWorkspace;
|
||||||
int32 fPreviousWorkspace;
|
int32 fPreviousWorkspace;
|
||||||
|
|
||||||
WindowList fAllWindows;
|
WindowList fAllWindows;
|
||||||
WindowList fSubsetWindows;
|
WindowList fSubsetWindows;
|
||||||
WindowList fFocusList;
|
WindowList fFocusList;
|
||||||
|
|
||||||
BObjectList<WorkspacesView> fWorkspacesViews;
|
BObjectList<WorkspacesView> fWorkspacesViews;
|
||||||
BLocker fWorkspacesLock;
|
BLocker fWorkspacesLock;
|
||||||
|
|
||||||
Screen* fActiveScreen;
|
Screen* fActiveScreen;
|
||||||
|
|
||||||
CursorManager fCursorManager;
|
CursorManager fCursorManager;
|
||||||
|
|
||||||
#if USE_MULTI_LOCKER
|
#if USE_MULTI_LOCKER
|
||||||
MultiLocker fWindowLock;
|
MultiLocker fWindowLock;
|
||||||
#else
|
#else
|
||||||
BLocker fWindowLock;
|
BLocker fWindowLock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BRegion fBackgroundRegion;
|
BRegion fBackgroundRegion;
|
||||||
BRegion fScreenRegion;
|
BRegion fScreenRegion;
|
||||||
|
|
||||||
Window* fMouseEventWindow;
|
Window* fMouseEventWindow;
|
||||||
const Window* fWindowUnderMouse;
|
const Window* fWindowUnderMouse;
|
||||||
const Window* fLockedFocusWindow;
|
const Window* fLockedFocusWindow;
|
||||||
int32 fViewUnderMouse;
|
int32 fViewUnderMouse;
|
||||||
BPoint fLastMousePosition;
|
BPoint fLastMousePosition;
|
||||||
int32 fLastMouseButtons;
|
int32 fLastMouseButtons;
|
||||||
|
|
||||||
Window* fFocus;
|
Window* fFocus;
|
||||||
Window* fFront;
|
Window* fFront;
|
||||||
Window* fBack;
|
Window* fBack;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DESKTOP_H
|
#endif // DESKTOP_H
|
||||||
|
|||||||
@@ -143,18 +143,14 @@ ScreenConfigurations::Set(int32 id, const monitor_info* info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
void
|
||||||
ScreenConfigurations::Update(int32 id, const display_mode& mode)
|
ScreenConfigurations::Remove(screen_configuration* configuration)
|
||||||
{
|
{
|
||||||
screen_configuration* configuration = CurrentByID(id);
|
|
||||||
if (configuration == NULL)
|
if (configuration == NULL)
|
||||||
return B_BAD_VALUE;
|
return;
|
||||||
|
|
||||||
configuration->is_current = true;
|
fConfigurations.RemoveItem(configuration);
|
||||||
|
// this also deletes the configuration
|
||||||
memcpy(&configuration->mode, &mode, sizeof(display_mode));
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
status_t Set(int32 id, const monitor_info* info,
|
status_t Set(int32 id, const monitor_info* info,
|
||||||
const BRect& frame,
|
const BRect& frame,
|
||||||
const display_mode& mode);
|
const display_mode& mode);
|
||||||
status_t Update(int32 id, const display_mode& mode);
|
void Remove(screen_configuration* configuration);
|
||||||
|
|
||||||
status_t Store(BMessage& settings) const;
|
status_t Store(BMessage& settings) const;
|
||||||
status_t Restore(const BMessage& settings);
|
status_t Restore(const BMessage& settings);
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include <FontPrivate.h>
|
#include <FontPrivate.h>
|
||||||
#include <MessengerPrivate.h>
|
#include <MessengerPrivate.h>
|
||||||
|
#include <PrivateScreen.h>
|
||||||
#include <RosterPrivate.h>
|
#include <RosterPrivate.h>
|
||||||
#include <ServerProtocol.h>
|
#include <ServerProtocol.h>
|
||||||
#include <WindowPrivate.h>
|
#include <WindowPrivate.h>
|
||||||
@@ -95,6 +96,7 @@ ServerApp::ServerApp(Desktop* desktop, port_id clientReplyPort,
|
|||||||
fSignature(signature),
|
fSignature(signature),
|
||||||
fClientTeam(clientTeam),
|
fClientTeam(clientTeam),
|
||||||
fWindowListLock("window list"),
|
fWindowListLock("window list"),
|
||||||
|
fTemporaryDisplayModeChange(0),
|
||||||
fAppCursor(NULL),
|
fAppCursor(NULL),
|
||||||
fViewCursor(NULL),
|
fViewCursor(NULL),
|
||||||
fCursorHideLevel(0),
|
fCursorHideLevel(0),
|
||||||
@@ -185,6 +187,8 @@ ServerApp::~ServerApp()
|
|||||||
fWindowListLock.Lock();
|
fWindowListLock.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fDesktop->RevertScreenModes(fTemporaryDisplayModeChange);
|
||||||
|
|
||||||
for (int32 i = fBitmapList.CountItems(); i-- > 0;) {
|
for (int32 i = fBitmapList.CountItems(); i-- > 0;) {
|
||||||
gBitmapManager->DeleteBitmap((ServerBitmap*)fBitmapList.ItemAt(i));
|
gBitmapManager->DeleteBitmap((ServerBitmap*)fBitmapList.ItemAt(i));
|
||||||
}
|
}
|
||||||
@@ -2319,6 +2323,20 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
status = fDesktop->SetScreenMode(workspace, id, mode,
|
status = fDesktop->SetScreenMode(workspace, id, mode,
|
||||||
makeDefault);
|
makeDefault);
|
||||||
}
|
}
|
||||||
|
if (status == B_OK) {
|
||||||
|
if (workspace == (uint32)B_CURRENT_WORKSPACE_INDEX
|
||||||
|
&& fDesktop->LockSingleWindow()) {
|
||||||
|
workspace = fDesktop->CurrentWorkspace();
|
||||||
|
fDesktop->UnlockSingleWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!makeDefault) {
|
||||||
|
// Memorize the screen change, so that it can be reverted
|
||||||
|
// later
|
||||||
|
fTemporaryDisplayModeChange |= 1 << workspace;
|
||||||
|
} else
|
||||||
|
fTemporaryDisplayModeChange &= ~(1 << workspace);
|
||||||
|
}
|
||||||
|
|
||||||
fLink.StartMessage(status);
|
fLink.StartMessage(status);
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2006, Haiku.
|
* Copyright 2001-2009, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -41,11 +41,10 @@ namespace BPrivate {
|
|||||||
class ServerApp : public MessageLooper {
|
class ServerApp : public MessageLooper {
|
||||||
public:
|
public:
|
||||||
ServerApp(Desktop* desktop,
|
ServerApp(Desktop* desktop,
|
||||||
port_id clientAppPort,
|
port_id clientAppPort,
|
||||||
port_id clientLooperPort,
|
port_id clientLooperPort,
|
||||||
team_id clientTeamID,
|
team_id clientTeamID, int32 handlerID,
|
||||||
int32 handlerID,
|
const char* signature);
|
||||||
const char* signature);
|
|
||||||
virtual ~ServerApp();
|
virtual ~ServerApp();
|
||||||
|
|
||||||
status_t InitCheck();
|
status_t InitCheck();
|
||||||
@@ -105,6 +104,7 @@ private:
|
|||||||
|
|
||||||
bool _HasWindowUnderMouse();
|
bool _HasWindowUnderMouse();
|
||||||
|
|
||||||
|
private:
|
||||||
port_id fMessagePort;
|
port_id fMessagePort;
|
||||||
port_id fClientReplyPort;
|
port_id fClientReplyPort;
|
||||||
// our BApplication's event port
|
// our BApplication's event port
|
||||||
@@ -128,6 +128,7 @@ private:
|
|||||||
BPrivate::BTokenSpace fViewTokens;
|
BPrivate::BTokenSpace fViewTokens;
|
||||||
|
|
||||||
int32 fInitialWorkspace;
|
int32 fInitialWorkspace;
|
||||||
|
uint32 fTemporaryDisplayModeChange;
|
||||||
|
|
||||||
// NOTE: Bitmaps and Pictures are stored globally, but ServerApps
|
// NOTE: Bitmaps and Pictures are stored globally, but ServerApps
|
||||||
// remember which ones they own so that they can destroy them when
|
// remember which ones they own so that they can destroy them when
|
||||||
|
|||||||
Reference in New Issue
Block a user