mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
WindowServer+MouseSettings: Toggle cursor highlighting with Super+H
Rather than enabling/disabling cursor highlighting by going into mouse settings, you can now instead toggle it any time with Super+H. Mouse settings now is only for customising the look of the highlighting.
This commit is contained in:
parent
3c2c6790df
commit
5caf307ec0
5 changed files with 46 additions and 48 deletions
|
@ -1697,40 +1697,47 @@ void WindowManager::process_key_event(KeyEvent& event)
|
|||
if (!active_input_window)
|
||||
return;
|
||||
|
||||
if (event.type() == Event::KeyDown && event.modifiers() == Mod_Super && active_input_window->type() != WindowType::Desktop) {
|
||||
if (event.key() == Key_Down) {
|
||||
if (active_input_window->is_resizable() && active_input_window->is_maximized()) {
|
||||
maximize_windows(*active_input_window, false);
|
||||
return;
|
||||
}
|
||||
if (active_input_window->is_minimizable())
|
||||
minimize_windows(*active_input_window, true);
|
||||
if (event.type() == Event::KeyDown && event.modifiers() == Mod_Super) {
|
||||
if (event.key() == Key_H) {
|
||||
m_cursor_highlight_enabled = !m_cursor_highlight_enabled;
|
||||
Compositor::the().invalidate_cursor();
|
||||
return;
|
||||
}
|
||||
if (active_input_window->is_resizable()) {
|
||||
if (event.key() == Key_Up) {
|
||||
maximize_windows(*active_input_window, !active_input_window->is_maximized());
|
||||
return;
|
||||
}
|
||||
if (event.key() == Key_Left) {
|
||||
if (active_input_window->tile_type() == WindowTileType::Left) {
|
||||
active_input_window->set_untiled();
|
||||
if (active_input_window->type() != WindowType::Desktop) {
|
||||
if (event.key() == Key_Down) {
|
||||
if (active_input_window->is_resizable() && active_input_window->is_maximized()) {
|
||||
maximize_windows(*active_input_window, false);
|
||||
return;
|
||||
}
|
||||
if (active_input_window->is_maximized())
|
||||
maximize_windows(*active_input_window, false);
|
||||
active_input_window->set_tiled(WindowTileType::Left);
|
||||
if (active_input_window->is_minimizable())
|
||||
minimize_windows(*active_input_window, true);
|
||||
return;
|
||||
}
|
||||
if (event.key() == Key_Right) {
|
||||
if (active_input_window->tile_type() == WindowTileType::Right) {
|
||||
active_input_window->set_untiled();
|
||||
if (active_input_window->is_resizable()) {
|
||||
if (event.key() == Key_Up) {
|
||||
maximize_windows(*active_input_window, !active_input_window->is_maximized());
|
||||
return;
|
||||
}
|
||||
if (event.key() == Key_Left) {
|
||||
if (active_input_window->tile_type() == WindowTileType::Left) {
|
||||
active_input_window->set_untiled();
|
||||
return;
|
||||
}
|
||||
if (active_input_window->is_maximized())
|
||||
maximize_windows(*active_input_window, false);
|
||||
active_input_window->set_tiled(WindowTileType::Left);
|
||||
return;
|
||||
}
|
||||
if (event.key() == Key_Right) {
|
||||
if (active_input_window->tile_type() == WindowTileType::Right) {
|
||||
active_input_window->set_untiled();
|
||||
return;
|
||||
}
|
||||
if (active_input_window->is_maximized())
|
||||
maximize_windows(*active_input_window, false);
|
||||
active_input_window->set_tiled(WindowTileType::Right);
|
||||
return;
|
||||
}
|
||||
if (active_input_window->is_maximized())
|
||||
maximize_windows(*active_input_window, false);
|
||||
active_input_window->set_tiled(WindowTileType::Right);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2294,11 +2301,6 @@ void WindowManager::set_cursor_highlight_color(Gfx::Color const& color)
|
|||
sync_config_to_disk();
|
||||
}
|
||||
|
||||
bool WindowManager::is_cursor_highlight_enabled() const
|
||||
{
|
||||
return m_cursor_highlight_radius > 0 && m_cursor_highlight_color.alpha() > 0;
|
||||
}
|
||||
|
||||
bool WindowManager::sync_config_to_disk()
|
||||
{
|
||||
if (auto result = m_config->sync(); result.is_error()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue