mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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:
parent
bee4544192
commit
0a1bd03f1d
Notes:
sideshowbarker
2024-07-19 13:16:59 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/0a1bd03f1d4 Pull-request: https://github.com/SerenityOS/serenity/pull/302
7 changed files with 17 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -28,6 +28,7 @@ enum WSAPI_WindowType {
|
|||
Taskbar,
|
||||
Tooltip,
|
||||
Menubar,
|
||||
Launcher,
|
||||
};
|
||||
|
||||
struct WSAPI_WindowBackingStoreInfo {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue