Some paths of the mouse event processing code will upgrade the event
from a regular MouseDown to a MouseDoubleClick. That's why we were
passing `MouseEvent&` everywhere.
For the paths that don't need to do this, passing `MouseEvent const&`
reduces the cognitive burden a bit, so let's do that.
Instead of plumbing a Window* through the entire mouse event processing
logic, just do a hit test and say that the window under the cursor is
the hovered window.
It's funny how much easier this is now that we have a way to hit test
the entire window stack with one call.
Move the logic for processing a mouse event that hits a specific window
into its own function.
If the window is blocked by a modal child, we now get that out of the
way first, so we don't have to think about it later.
Even if a window is in fullscreen mode, we still want hit testing to
walk the window stack. Otherwise child windows of the fullscreen
window will not receive mouse events.
The button widgets internally rendered by WindowServer are only used
in titlebars, and require a bit of mouse event handling. Instead of
mixing it with the window-oriented mouse event handling, get the
button event stuff out of the way first.
We were forgetting to preserve the m_drag and m_mime_data members of
WindowServer::MouseEvent when making a translated copy.
This didn't affect any reachable code paths before this change.
Previously, if a drag operation was aborted by pressing the escape key
(handled by WindowServer), the drag would immediately restart if you
moved the mouse cursor before releasing the mouse button.
If a window is currently actively tracking input events (because
sent it a MouseDown and haven't sent it a MouseUp yet), we now simply
send mouse events to that window right away before doing any other
event processing.
This makes it much easier to reason about mouse events.
Instead of just answering hit/no-hit when hit testing windows, we now
return a HitTestResult object which tells you which window was hit,
where it was hit, and whether you hit the frame or the content.
This feature had been there since early on and was not actually useful
for anything. I just added it because it was fun. In retrospect, it's
not a very good feature and I only ever activated it by accident.
This patch moves the window stack out of WindowManager and into its own
WindowStack class.
A WindowStack is an ordered list of windows with an optional highlight
window. The highlight window mechanism is used during Super+Tab window
switching to temporarily bring a window to the front.
This is mostly mechanical, just moving the code to its own class.
While these look nice, they require the discord workflow to sit around
and wait for the build-and-lint workflow to finish in order to get its
status which means we waste an extra workflow runner that does nothing
for each build-and-lint run.
We now store the device descriptor obtained from the device
during enumeration in the device's object in memory instead
of exposing all of the different members contained within it.
The specification defines that we should only change attributes that
exist in the incoming descriptor, but since we currently just overwrite
the existing descriptor with the new one, we can just set the missing
attributes to the existing values manually.
It was missing an exception check on the call to to_primitive.
This fixes test/built-ins/Date/prototype/toJSON/called-as-function.js
from test262 crashing, but does not fix the test itself.
The commit c2b47c067 (LibC: Add stubs for wctype and iswctype,
2021-05-27) introduced the wctype.h header, which caused the less port
to try to build with wchar support. This patches the header generated by
the configure script to remove wchar support.
inode identifiers in ProcFS are encoded in a way that the parent ID is
shifted 12 bits to the left and the PID is shifted by 16 bits. This
means that the rightmost 12 bits are reserved for the file type or the
fd.
Since the to_fd and to_proc_file_type decoders only decoded the
rightmost 8 bits, decoded values would wrap around beyond values of 255,
resulting in a different value compared to what was originally encoded.
If FXSR is not present, fall back to fnsave and frstor instructions.
These instructions aren't available on the canonical i686 CPU which is
the Pentium Pro processor.