Age | Commit message (Collapse) | Author |
|
|
|
Previously it was possible for a window to register as a parentless
blocking modal then add itself to a stealable parent's modal chain,
bypassing a mode misbehavior check in create_window()
Also relaxes reciprocity for blockers with the same parent. This
scenario is usually created by simultaneous MessageBoxes. It's not
an ideal UX to cascade these, but there's no need to crash over it.
|
|
|
|
Saves Dialogs the trouble of accounting for variable width titles and
makes all unresizable windows more responsive to font changes.
|
|
This adds a tiling mode that will show a tile window overlay rather
than immediately tiling a window, triggering window resizes.
|
|
|
|
This is referred to as the name everywhere else, so we should be
consistent here.
|
|
|
|
|
|
Those don't have any non-try counterpart, so we might as well just omit
it.
|
|
The old `GUI::Window` resizing behavior created a new backing store for
each resize event (i.e. every visible window size). This caused a lot of
trashing and on my machine, caused up to 25% of CPU time spent in
creating new backing stores.
The new behavior is a bit more sensible:
* If the window size is shrinking, the backing store is already large
enough to contain the entire window - so we don't create a new one.
* If the window size is growing, as soon as the backing store can no
longer contain the window, it is inflated with a large margin (of an
arbitrary chosen 64 pixels) in both directions to accommodate some
leeway in resizing before an even larger backing store is required.
* When the user stops resizing the window, the backing store is
resized to the exact dimensions of the window.
For me, this brings the CPU time for creating backing stores down to 0%.
|
|
clang-format sure has some interesting opinions about where to put a
method call that comes after a lambda. :thonk:
|
|
This makes system font changes actually persist across reboots.
|
|
Instead of opening and reparsing WindowServer.ini at random occasions,
just keep the file open after loading it in serenity_main().
This avoids a bunch of unnecessary work, and also fixes an issue where
WindowManager::m_config might re-write stale values to disk.
|
|
Having a `Point`, `Rect` or `Size` claim it's `null` is silly. We have
`Optional<T>` for that. For `Point`, rename `is_null` to `is_zero` to
better reflect what we're testing. For `Rect` and `Size`, `is_null` is
removed outright.
Also, remove `is_empty` from `Point`. Points can't be empty.
|
|
This function is only used by the magnifier currently.
Since we now apply the scaling factor in Bitmap::cropped(), this is not
necessary anymore.
|
|
|
|
Fixes checkable MenuItems drawing incorrectly due to shifted defaults.
|
|
This patch adds a visibility state to GUI::Action. All actions default
to being visible. When invisible, they do not show up in toolbars on
menus (and importantly, they don't occupy any space).
This can be used to hide/show context-sensitive actions dynamically
without rebuilding menus and toolbars.
Thanks to Tim Slater for assuming that action visibility was a thing,
which gave me a reason to implement it! :^)
|
|
Before this commit it was a bit ambiguous which buttons the function
name were referring to; this instead now makes it clear that it's
related to mouse input. Additionally, this also fixes incorrect getter
naming leftover from yesteryear.
|
|
Just two ints like Gfx::IntPoint.
|
|
This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
|
|
Gfx::Color is always 4 bytes (it's just a wrapper over u32) it's less
work just to pass the color directly.
This also updates IPCCompiler to prevent from generating
Gfx::Color const &, which makes replacement easier.
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
Also commonly referred to as "reverse scrolling" or "inverted
scrolling".
|
|
Two Blocking modals in the same modal chain which aren't descended
one from the other will block each other's input rendering the chain
noninteractive. This has caused confusion in the past for builders so
this warning makes the behavior explicitly forbidden.
|
|
These lambdas were marked mutable as they captured a Ptr wrapper
class by value, which then only returned const-qualified references
to the value they point from the previous const pointer operators.
Nothing is actually mutating in the lambdas state here, and now
that the Ptr operators don't add extra const qualifiers these
can be removed.
|
|
The backend methods in WindowServer already exist. This just adds the
IPC plumbing to connect those methods to GUI::Window.
|
|
Putting the implementations in the .cpp file meant that they only
existed for `IntRect` and `FloatRect`, since those were instantiated at
the bottom of the file. Now they work for other types. :^)
A couple of places in WindowServer had to be modified to disambiguate
between the two `Rect::intersected()` overloads.
Co-authored-by: davidot <davidot@serenityos.org>
|
|
If `window` is nullptr, we should return as soon as possible to
avoid segment fault runtime error.
|
|
|
|
The hot-spots for resizing a window by dragging its corner are now
limited to a small area around the actual corner instead of an area with
1/3rd the length or width of the window.
The hot-spots to resize a window while holding a modifier key and the
right mouse button are unchanged.
|
|
Instead of letting buttons determine the relative position
of their menus, a workaround only used by Statusbar segments,
open them all uniformly for a nice, consistent UI.
Passing a rect to popup() now routes to open_button_menu(), an
analog to open_menubar_menu(), which adjusts the menu's popup
position in the same way. Fixes button menus obscuring the buttons
which spawn them and jutting out at odd corners depending on screen
position.
|
|
|
|
This was too restrictive and there are already UI elements that rely
on this behavior. Now Blocking modals will preempt interaction with
all windows in their modal chain except those descending from them.
Fixes crashing in FilePicker when permission is denied.
|
|
This exception is necessary for ComboBoxes used in some blocking
Dialogs. CaptureInput is now the only mode which can spawn from
a blocking modal and it won't accept any children of its own.
|
|
with the CaptureInput WindowMode. This mode will serve the same
function as accessories: redirecting input while allowing parent
windows to remain active.
|
|
with the RenderAbove WindowMode. This mode will ensure child
windows always draw above their parents, even when focus is lost.
RenderAbove modals are automatically themed the same as the old
ToolWindows. Fixes ToolWindows rendering above ALL normal windows,
regardless of parent. We can't rely on WindowType to create these
sort of effects because of WindowManager's strict display hierarchy.
|
|
Previously, Windows only understood blocking modality: Windows were
either modal, i.e., in a blocking state, or not. Windows could also
be set as Accessories or ToolWindows, attributes which technically
applied modes to their parents but were implemented ad hoc. This patch
redefines these modal effects as WindowModes and sets up some helpers.
This will let us simplify a lot of modal logic in the upcoming patches
and make it easier to build new modal effects in the future.
Windows can now set 1 of 5 modes before reification:
-Modeless: No modal effect; begins a new modal chain
-Passive: Window joins its modal chain but has no effect
-RenderAbove: Window renders above its parent
-CaptureInput: Window captures the active input role from its parent
-Blocking: Window blocks all interaction with its modal chain
States like fullscreen and tiling are dynamic and don't alter behavior
in modal chains, so they aren't included.
|
|
Positioning windows outside visible coordinates is valid if sometimes
curious behavior, but it shouldn't be considered misbehavior by default.
There are multiple ways to recover windows with obscured title bars,
and this function papers over actual resize bugs and is no longer
needed to normalize window size, so let's remove it for now.
|
|
And remove unnecessary workarounds to the old limit of {50, 50} and
the cautious but arbitrary limit of {1, 1} for other WindowTypes.
Null rects are already the default when calculating minimum window
size and are the least restrictive but valid value.
Also returns early during minimum size calculations for frameless
windows, and verifies against negative minimum sizes and failure to
disable widget min size before setting a minimum window size. Layout
automatically overrides this setting each relayout otherwise.
|
|
This fixes an issue where the undo/redo actions in TextEditor only
updated once you hovered over them.
|
|
Adds a member to record the last processed mouse buttons. If they
do not include MouseButton::Primary, return early before creating
a new drag and drop client. This fixes race conditions in which
MouseUp events canceling or completing a drop could be swallowed
by Overlay creation or postponed by an executing DragOperation,
leaving the operation in limbo.
|
|
SystemEffects are sent to the WindowManager through
set_system_effects() and broadcast to Desktop clients with
update_system_effects(). WindowManager is reponsible for saving,
loading and rebroadcasting effects from WindowServer.ini on
config changes.
|
|
Previously we would wait for a separate message confirming that a
wallpaper got set instead of just calling a synchronous api.
I'm guessing that this was a limitation of the IPC system when
WindowServer got ported to using it.
This patch removes the SetWallpaperFinished message and updates the
set_wallpaper api to synchronously return a success boolean.
|
|
Instead of defaulting to "bold variant of the system default font",
let's allow the user to set any font they want as the titlebar font.
|
|
Previously, windows without a defined minimum size (or one produced from
the minimum sizes of their contents) would be shrunk down to 0 x 0,
which makes the title buttons stick out the side and become impossible
to interact with.
This patch uses the theme metrics to calculate a minimum size that is as
small as possible while still keeping the title buttons and app icon
usable. This is combined with the minimum size requested by the app
itself.
Switching themes automatically updates the calculated minimum sizes for
all existing windows. As noted, if the new theme has narrower title
buttons then the old minimum is kept, but this shouldn't be noticeable
unless you're looking for it.
|
|
This patch adds a new api to override the current system theme with an
in memory override theme.
|
|
|
|
Previously when setting an action's icon we would only change the bitmap
stored by the action. This patch adds logic to propagate that change to
toolbar buttons as well as window menus.
This fixes an issue in SoundPlayer that would cause the play button not
to reflect the play state.
|