1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

WindowServer: Add a custom window type for Launcher

This keeps it out of the taskbar window list.
The stacking order is a little gnarly, but it seems to work OK still.
This commit is contained in:
Robin Burchell 2019-07-13 23:51:33 +02:00 committed by Andreas Kling
parent bee4544192
commit 0a1bd03f1d
7 changed files with 17 additions and 1 deletions

View file

@ -72,6 +72,7 @@ GWindow* make_launcher_window()
int launcher_size = (config->groups().size() - 1) * 50; int launcher_size = (config->groups().size() - 1) * 50;
window->set_rect(50, 50, vertical ? 50 : launcher_size, vertical ? launcher_size : 50); window->set_rect(50, 50, vertical ? 50 : launcher_size, vertical ? launcher_size : 50);
window->set_show_titlebar(false); window->set_show_titlebar(false);
window->set_window_type(GWindowType::Launcher);
auto* widget = new GWidget; auto* widget = new GWidget;
widget->set_fill_with_background_color(true); widget->set_fill_with_background_color(true);

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
// Keep this in sync with WSWindowType.
enum class GWindowType { enum class GWindowType {
Invalid = 0, Invalid = 0,
Normal, Normal,
@ -7,4 +8,6 @@ enum class GWindowType {
WindowSwitcher, WindowSwitcher,
Taskbar, Taskbar,
Tooltip, Tooltip,
Menubar,
Launcher,
}; };

View file

@ -28,6 +28,7 @@ enum WSAPI_WindowType {
Taskbar, Taskbar,
Tooltip, Tooltip,
Menubar, Menubar,
Launcher,
}; };
struct WSAPI_WindowBackingStoreInfo { struct WSAPI_WindowBackingStoreInfo {

View file

@ -211,6 +211,9 @@ bool WSEventLoop::on_receive_from_client(int client_id, const WSAPI_ClientMessag
case WSAPI_WindowType::Menubar: case WSAPI_WindowType::Menubar:
ws_window_type = WSWindowType::Menubar; ws_window_type = WSWindowType::Menubar;
break; break;
case WSAPI_WindowType::Launcher:
ws_window_type = WSWindowType::Launcher;
break;
case WSAPI_WindowType::Invalid: case WSAPI_WindowType::Invalid:
default: default:
dbgprintf("Unknown WSAPI_WindowType: %d\n", message.window.type); dbgprintf("Unknown WSAPI_WindowType: %d\n", message.window.type);

View file

@ -140,6 +140,8 @@ static WSAPI_WindowType to_api(WSWindowType ws_type)
return WSAPI_WindowType::Tooltip; return WSAPI_WindowType::Tooltip;
case WSWindowType::Menubar: case WSWindowType::Menubar:
return WSAPI_WindowType::Menubar; return WSAPI_WindowType::Menubar;
case WSWindowType::Launcher:
return WSAPI_WindowType::Launcher;
default: default:
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
} }

View file

@ -277,6 +277,8 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_back_to_
template<typename Callback> template<typename Callback>
IterationDecision WSWindowManager::for_each_visible_window_from_back_to_front(Callback callback) IterationDecision WSWindowManager::for_each_visible_window_from_back_to_front(Callback callback)
{ {
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Launcher, callback) == IterationDecision::Break)
return IterationDecision::Break;
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Normal, callback) == IterationDecision::Break) if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Normal, callback) == IterationDecision::Break)
return IterationDecision::Break; return IterationDecision::Break;
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Taskbar, callback) == IterationDecision::Break) if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Taskbar, callback) == IterationDecision::Break)
@ -326,7 +328,9 @@ IterationDecision WSWindowManager::for_each_visible_window_from_front_to_back(Ca
return IterationDecision::Break; return IterationDecision::Break;
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Tooltip, callback) == IterationDecision::Break) if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Tooltip, callback) == IterationDecision::Break)
return IterationDecision::Break; return IterationDecision::Break;
return for_each_visible_window_of_type_from_front_to_back(WSWindowType::Normal, callback); if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Normal, callback) == IterationDecision::Break)
return IterationDecision::Break;
return for_each_visible_window_of_type_from_front_to_back(WSWindowType::Launcher, callback);
} }
template<typename Callback> template<typename Callback>

View file

@ -1,5 +1,6 @@
#pragma once #pragma once
// Keep this in sync with GWindowType.
enum class WSWindowType { enum class WSWindowType {
Invalid = 0, Invalid = 0,
Normal, Normal,
@ -8,4 +9,5 @@ enum class WSWindowType {
Taskbar, Taskbar,
Tooltip, Tooltip,
Menubar, Menubar,
Launcher,
}; };