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
Notes: sideshowbarker 2024-07-19 13:16:59 +09:00
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;
window->set_rect(50, 50, vertical ? 50 : launcher_size, vertical ? launcher_size : 50);
window->set_show_titlebar(false);
window->set_window_type(GWindowType::Launcher);
auto* widget = new GWidget;
widget->set_fill_with_background_color(true);

View file

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

View file

@ -28,6 +28,7 @@ enum WSAPI_WindowType {
Taskbar,
Tooltip,
Menubar,
Launcher,
};
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:
ws_window_type = WSWindowType::Menubar;
break;
case WSAPI_WindowType::Launcher:
ws_window_type = WSWindowType::Launcher;
break;
case WSAPI_WindowType::Invalid:
default:
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;
case WSWindowType::Menubar:
return WSAPI_WindowType::Menubar;
case WSWindowType::Launcher:
return WSAPI_WindowType::Launcher;
default:
ASSERT_NOT_REACHED();
}

View file

@ -277,6 +277,8 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_back_to_
template<typename 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)
return 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;
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Tooltip, callback) == 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>

View file

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