BScreen uses ~0 to denote the current workspace *index*. This should fix
ticket #4144. Untested. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31864 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2313,24 +2313,29 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
|
|
||||||
if (status == B_OK && fDesktop->LockAllWindows()) {
|
if (status == B_OK && fDesktop->LockAllWindows()) {
|
||||||
display_mode oldMode;
|
display_mode oldMode;
|
||||||
if (workspace == (uint32)fDesktop->CurrentWorkspace()) {
|
// TODO: This is a bit of a mess. The API to set the mode on
|
||||||
|
// a specific workspace was not present in BeOS. It is meant to
|
||||||
|
// be the workspace *index* (not the bitfield). However, the
|
||||||
|
// "~0" is used as kCurrentWorkspace in PrivateScreen.cpp, which
|
||||||
|
// has nothing to do with B_CURRENT_WORKSPACE (== 0, used for the
|
||||||
|
// workspace bit mask of a BWindow).
|
||||||
|
if (workspace == (uint32)~0
|
||||||
|
|| workspace == (uint32)fDesktop->CurrentWorkspace()) {
|
||||||
fDesktop->ScreenAt(0)->GetMode(&oldMode);
|
fDesktop->ScreenAt(0)->GetMode(&oldMode);
|
||||||
if (memcmp(&oldMode, &mode, sizeof(display_mode))) {
|
if (memcmp(&oldMode, &mode, sizeof(display_mode))) {
|
||||||
status = fDesktop->ScreenAt(0)->SetMode(mode, makeDefault);
|
status = fDesktop->ScreenAt(0)->SetMode(mode,
|
||||||
|
makeDefault);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
fDesktop->ScreenChanged(fDesktop->ScreenAt(0), makeDefault);
|
fDesktop->ScreenChanged(fDesktop->ScreenAt(0),
|
||||||
|
makeDefault);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
status = B_OK;
|
status = B_OK;
|
||||||
} else {
|
} else {
|
||||||
// this is perhaps not ideal - it assumes that if the
|
// If you don't intend to make the screen mode the default
|
||||||
// workspace is not the active one, then pull the
|
// for the given workspace, then you cannot change the
|
||||||
// configuration from active and store it to the specified
|
// configuration at all. I.e. non-default (not permanent)
|
||||||
// workspace. This is safer since it's assumed that the
|
// screen modes only work for the current workspace.
|
||||||
// active workspace has a display mode that's usable,
|
|
||||||
// but at the same time the API implies that you can set
|
|
||||||
// a non-visible workspace to whatever mode you like
|
|
||||||
// TODO: decide what to do here.
|
|
||||||
if (makeDefault)
|
if (makeDefault)
|
||||||
fDesktop->StoreConfiguration(workspace);
|
fDesktop->StoreConfiguration(workspace);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user