While structs being forward declared as classes is not strictly an
issue, Clang complains as this is not portable code, since some ABIs
treat classes declared as `class` and `struct` differently.
It's easier to fix these than to reason about explicitly disabling
another warning.
It might be the case that we are passing non-movable/non-copyable things
through IPC. In this case, Clang will emit a warning as it can't
generate the requested default move/copy ctor for the IPC message.
To fix this, we use a `#pragma` to make the compiler silently ignore our
request.
The same was the case with the three-way comparison in `Screen`. Since
we don't use the three-way comparison operator anywhere else in our
codebase, we simply use the `==` operator instead.
This fixes a bug with menu keyboard navigation. If you pressed the right
arrow to enter a submenu, then the left arrow to exit the submenu, then
right and left again it would leave no menu item selected.
Because descending into the submenu wasn't making it the current menu,
when you press the left arrow it couldn't find the "current menu" in the
stack, so didn't know what menu to pop back to.
It was an accident that it worked the first time you navigated into the
menu. Selecting the parent item also opened the submenu, and opening
an already open menu sets it as the current menu. After closing the
submenu with the left arrow, it is no longer already open, so it wasn't
getting set as the current menu.
Before this change, invalidating any rect in a WindowFrame would cause
the entire window (including frame & drop shadow) to get invalidated,
leading to copious amounts of overdraw when mousing over menubars,
titlebars, and window buttons.
We now simply allow the partial frame invalidations through to the
window's dirty rects collection and the compositor takes care of it.
ec6debb changed item_index_at to return -1 when hovering over a
separator. The intent was to not send the separator to clients for
MenuItemEntered.
However, this had the unintented consequence of not closing the submenu
when you hover over a separator. Submenus ignore when the item index is
-1 in order to leave the menu open when you move the mouse outside. This
ends up leaving the submenu open without the highlight to show what menu
item the submenu belongs to.
A slightly less severe consequence is that pressing the up or down arrow
key in such a situation would now go the top or bottom of the menu
rather than the item above or below the separator.
We now push the special casing of separators into set_hovered_index so
that the rest of the code behaves as it did before ec6debb.
Previously, this mode would flash flush/repaint rects in yellow for
however it long it took for the compositor to replace the yellow with
the final image instead.
Now we usleep() for 10 ms when flashing, so you get a chance to see
the yellow. This immediately makes "flash flush" mode super useful. :^)
This patch adds the concept of a window being "Pinnable" (always drawn
on top of other windows). This can be toggled through a new checkable
action in the top left corner's window menu.
Because window states and various flags can affect the windows'
rendered areas it's safer to use the last computed occlusion rectangles
to invalidate areas on the screen that may have to be re-rendered due
to e.g. a window size change.
Fixes#6723
Depending on the driver, the second buffer may not be located right
after the first, e.g. it may be page aligned. This removes this
assumption and queries the driver for the appropriate offset.
Some devices may require DMA transfers to flush the updated buffer
areas prior to flipping. For those devices we track the areas that
require flushing prior to the next flip. For devices that do not
support flipping, but require flushing, we'll simply flush after
updating the front buffer.
This also adds a small optimization that skips these steps entirely for
a screen that doesn't have any updates that need to be rendered.
The only remaining sync call from client to server is now the call
that switches a window's backing store. That one actually relies on
the synchronization to hand over ownership of the backing stores,
so it has to stay synchronous for now.
Differentiates between normal minimization and hidden windows. A window
which is hidden is still minimized, but can be seen as another stage
of being minimized.
Also, make it return a reference as aside from only three special
situations (creating, destroying, and moving a window between stacks)
a window should always be on a window stack. Any access during those
brief situations would be a bug, so we should VERIFY this.
This solves two problems:
* A window was sometimes deemed occluded when the window rect was
entirely covered by other rectangles, transparent or opaque. This
caused a window to stop rendering even if a small portion was still
visible, e.g. when it was merely covered by a window shadow.
* The window switcher is interested in window updates even when a
window is entirely covered by another one, or when it is on another
desktop. This forces windows to be not occluded in those cases.
When using the Super+Tab hotkey then all windows will be displayed,
and we will switch to another virtual desktop if needed.
When using the Alt+Tab hotkey then only the windows on the current
desktop will be displayed.
This also adds the ability to query how many virtual desktops are
set up, and for the Taskbar to be notified when the active virtual
desktop has changed.
This creates a 2-dimensional array of WindowStack instances, one for
each virtual desktop. The main desktop 0,0 is the main desktop, which
is the desktop used for all stationary windows (e.g. taskbar, desktop).
When adding windows to a desktop, stationary windows are always added
to the main desktop.
When composing the desktop, there are usually two WindowStacks
involved. For stationary windows, the main desktop will be traversed,
and for everything else the current virtual desktop will be iterated.
Iteration is interweaved to preserve the correct order. During the
transition animation, two WindowStacks will be iterated at the same
time.
This removes StringView::find_first_of(char) and find_last_of(char) and
replaces all its usages with find and find_last respectively. This is
because those two methods are functionally equivalent.
find_{first,last}_of should only be used if searching for multiple
different characters, which is never the case with the char argument.
This also adds the [[nodiscard]] to the remaining find_{first,last}_of
methods.
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.
To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
Since this is always set to true on the non-default constructor and
subsequently never modified, it is somewhat pointless. Furthermore,
there are arguably no invalid relative paths.
Add `inspect_dom_tree` to WebContentServer and 'did_get_dom_tree' to
WebContentClient.
These two async methods form a request & response for requesting a JSON
representation of the Content's DOM tree.
The time interval for animations is most often described as `duration`
in animation contexts and the `WindowServer::Animation` class
should reflect that.
The menus always thought they were being outside of the main screen,
which caused them to be left and/or top aligned. This also fixes the
calculation of the available space by using the screen rectangle where
it will be displayed.
We care about showing 'Assistant' app as fast as possible when the
hotkey is pressed. In order to do that, we can parse the `.af` file
ahead of time and have it ready to use.