* Introduced an initial application workspace - should be retrieved differently,

though (ideally when launched).
* B_MODAL_APP_WINDOW_FEEL windows are now visible on the initial app workspace
  in case it has no other window visible. This fixes the missing BAlerts in
  the debug_server or just the "alert" command. Thanks to Stephan for pointing
  this out.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15811 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-01-03 11:39:03 +00:00
parent 574af5597c
commit 843bc3cd0d
3 changed files with 30 additions and 4 deletions

View File

@ -126,6 +126,9 @@ ServerApp::ServerApp(Desktop* desktop, port_id clientReplyPort,
fAppCursor->SetOwningTeam(fClientTeam);
}
fInitialWorkspace = desktop->CurrentWorkspace();
// TODO: this should probably be retrieved when the app is loaded!
STRACE(("ServerApp %s:\n", Signature()));
STRACE(("\tBApp port: %ld\n", fClientReplyPort));
STRACE(("\tReceiver port: %ld\n", fMessagePort));

View File

@ -66,6 +66,7 @@ class ServerApp : public MessageLooper {
void RemoveWindow(ServerWindow* window);
bool InWorkspace(int32 index) const;
uint32 Workspaces() const;
int32 InitialWorkspace() const { return fInitialWorkspace; }
int32 CountBitmaps() const;
ServerBitmap *FindBitmap(int32 token) const;
@ -105,6 +106,8 @@ class ServerApp : public MessageLooper {
BObjectList<ServerWindow> fWindowList;
BPrivate::BTokenSpace fViewTokens;
int32 fInitialWorkspace;
// TODO:
// - Are really Bitmaps and Pictures stored per application and not globally ?
// - As we reference these stuff by token, what about putting them in hash tables ?

View File

@ -1237,10 +1237,20 @@ WindowLayer::InWorkspace(int32 index) const
|| fFeel == B_FLOATING_ALL_WINDOW_FEEL)
return true;
if (fFeel == B_MODAL_APP_WINDOW_FEEL
|| fFeel == B_FLOATING_APP_WINDOW_FEEL)
if (fFeel == B_FLOATING_APP_WINDOW_FEEL)
return ServerWindow()->App()->InWorkspace(index);
if (fFeel == B_MODAL_APP_WINDOW_FEEL) {
uint32 workspaces = ServerWindow()->App()->Workspaces();
if (workspaces == 0) {
// The application doesn't seem to have any other windows
// open or visible - but we'd like to see modal windows
// anyway, at least when they are first opened.
return index == ServerWindow()->App()->InitialWorkspace();
}
return (workspaces & (1UL << index)) != 0;
}
if (fFeel == B_MODAL_SUBSET_WINDOW_FEEL
|| fFeel == B_FLOATING_SUBSET_WINDOW_FEEL) {
for (int32 i = 0; i < fSubsets.CountItems(); i++) {
@ -1422,10 +1432,20 @@ WindowLayer::SubsetWorkspaces() const
|| fFeel == B_FLOATING_ALL_WINDOW_FEEL)
return B_ALL_WORKSPACES;
if (fFeel == B_MODAL_APP_WINDOW_FEEL
|| fFeel == B_FLOATING_APP_WINDOW_FEEL)
if (fFeel == B_FLOATING_APP_WINDOW_FEEL)
return ServerWindow()->App()->Workspaces();
if (fFeel == B_MODAL_APP_WINDOW_FEEL) {
uint32 workspaces = ServerWindow()->App()->Workspaces();
if (workspaces == 0) {
// The application doesn't seem to have any other windows
// open or visible - but we'd like to see modal windows
// anyway, at least when they are first opened.
return 1UL << ServerWindow()->App()->InitialWorkspace();
}
return workspaces;
}
if (fFeel == B_MODAL_SUBSET_WINDOW_FEEL
|| fFeel == B_FLOATING_SUBSET_WINDOW_FEEL) {
uint32 workspaces = 0;