summaryrefslogtreecommitdiff
path: root/Services/WindowServer
AgeCommit message (Collapse)Author
2021-01-12Services: Move to Userland/Services/Andreas Kling
2021-01-12AK: Simplify constructors and conversions from nullptr_tLenny Maiorani
Problem: - Many constructors are defined as `{}` rather than using the ` = default` compiler-provided constructor. - Some types provide an implicit conversion operator from `nullptr_t` instead of requiring the caller to default construct. This violates the C++ Core Guidelines suggestion to declare single-argument constructors explicit (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit). Solution: - Change default constructors to use the compiler-provided default constructor. - Remove implicit conversion operators from `nullptr_t` and change usage to enforce type consistency without conversion.
2021-01-11Vector: Implement `find`, `find_if`, `find_first_matching` in terms of ↵Lenny Maiorani
`AK::find*` Problem: - The implementation of `find` is coupled to the implementation of `Vector`. - `Vector::find` takes the predicate by value which might be expensive. Solution: - Decouple the implementation of `find` from `Vector` by using a generic `find` algorithm. - Change the name of `find` with a predicate to `find_if` so that a binding reference can be used and the predicate can be forwarded to avoid copies. - Change all the `find(pred)` call sites to use `find_if`.
2021-01-10Everywhere: Convert a bunch of dbgprintf() to dbgln()Andreas Kling
2021-01-09Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.Everything: The modifications in this commit were automatically made using the following command: find . -name '*.cpp' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-09WindowServer: Don't enter invalid state when using resize corner.Mart G
2021-01-09WindowServer+LibGUI: Pass the set of mime types being dragged to clientAndreas Kling
Previously the client would only learn the mime type of what was being dropped on it once the drop occurred. To enable more sophisticated filtering of drag & drop, we now pass along the list of mime types being dragged to the client with each MouseMove event. (Note that MouseMove is translated to the various Drag* events in LibGUI on the client side.)
2021-01-09WindowServer+LibGUI: Notify hovered window when drag&drop is cancelledAndreas Kling
The hovered window may want to react to a drag being cancelled, even if the drag originated in some other window.
2021-01-08WindowServer: is_blocked_by_modal_window() => blocking_modal_window()Andreas Kling
The name of this function was weird, since it returned the blocking modal window itself, and not just a bool answering the question.
2021-01-08WindowServer: Start blocked modal animation when clicking on frameTom
Fixes #4835
2021-01-01WindowServer: Flash modal window when clicking on window blocked by itAndreas Kling
This makes window modality a bit more discoverable by indicating to the user that the modal window must be closed before mouse interaction is possible in the clicked window.
2020-12-31WindowServer: Send WindowDeactivated event to windows blocked by modalLinus Groh
When a new modal window is created, we still want to forward the WindowDeactivated event to its parent window, despite it being blocked by the newly created modal (which causes WindowServer's Window::event() to ignore all incoming events from WindowManager for that window). This fixes the "terminal doesn't stop blinking when blocked by modal window" bug.
2020-12-30LibGFX: Move default_xxx_font() methods from Font to FontDatabaseStephan Unverwerth
When we have an abstract font class it makes no sense to keep these methods in the Font class.
2020-12-30WindowServer: Added IPC requests for getting and setting mouse settingsIdan Horowitz
These include the mouse acceleration factor and the scroll length step size.
2020-12-30WindowServer: Added configurable mouse acceleration and scroll lengthIdan Horowitz
The settings are also saved to the config file to survive reboots.
2020-12-28WindowServer: Add a GetGlobalCursorPosition IPC requestAndreas Kling
This tells you where the mouse cursor is in screen coordinates.
2020-12-28WindowServer: Remove unnecessary clang-format disabler commentAndreas Kling
2020-12-28WindowServer: Don't lookup configuration values in compose()Andreas Kling
The compose() function is supposed to be fast since it can execute 60 times per second. Let's not do obviously avoidable things like configuration value lookups in there. :^)
2020-12-28Base: Rename maximize/minimize icons to a more generic nameIdan Horowitz
This reduces naming confusion when the icons are used for other use cases that require a triangle shape
2020-12-28WindowServer: Spruce up the move/resize geometry label a little bitAndreas Kling
Draw it in a threed style with a little shadow under it.
2020-12-27LibGUI+WindowServer: Tweak hover shadows slightlyAndreas Kling
Move the shadow 1 more pixel away from the unhovered icon location, making a total 2 pixel distance between the icon and the shadow. Also tweak the shadow color to be a darkened variant of the base color underneath the icon.
2020-12-25WindowServer: Validate cursor type in SetWindowCursor message handlerLinus Groh
Fixes #4536.
2020-12-25Everywhere: Tweak "2020-2020" => "2020" in copyright headersAndreas Kling
2020-12-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-12-19WindowServer: Put tooltip windows above notification windowsAndreas Kling
2020-12-17WindowServer: Add the ability to animate cursorsTom
This adds the ability to specify cursor attributes as part of their file names, which allows us to remove hard coded values like the hot spot from the code. The attributes can be specified between the last two dots of the file name. Each attribute begins with a character, followed by one or more digits that specify a uint value. Supported attributes: x: The x-coordinate of the cursor hotspot y: The y-coordinate of the cursor hotspot f: The number of animated frames horizontally in the image t: The number of milliseconds per frame For example, the filename wait.f14t100.png specifies that the image contains 14 frames that should be cycled through at a rate of 100ms. The hotspot is not specified, so it defaults to the center.
2020-12-08WindowServer: Initial wallpaper must not be NULLBen Wiederhake
This used to crash 'pape -c' on a fresh image. Note that the special value is '', the empty string, and *not* NULL, i.e. an unset string. An empty string implies that the wallpaper is not an image, but rather a solid color.
2020-12-07WindowServer: Don't crash when pressing return after opening menuAndreas Kling
There isn't always a hovered item, so let's not assume things.
2020-12-06WindowServer: Allow for more flexible tilingJulian Offenhäuser
The desktop can now be split up into halves (both vertical and horizontal) and quarters by dragging a window into the corresponding edge or corner. This makes tiling behave more like you would expect from similiar window managers.
2020-11-10WindowServer: Show modal window's cursor over blocked windowsAndreas Kling
When a window is blocked by a modal window from the same application, we now prefer the modal window's cursor instead of the hovered window.
2020-11-10AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safeTom
This makes most operations thread safe, especially so that they can safely be used in the Kernel. This includes obtaining a strong reference from a weak reference, which now requires an explicit call to WeakPtr::strong_ref(). Another major change is that Weakable::make_weak_ref() may require the explicit target type. Previously we used reinterpret_cast in WeakPtr, assuming that it can be properly converted. But WeakPtr does not necessarily have the knowledge to be able to do this. Instead, we now ask the class itself to deliver a WeakPtr to the type that we want. Also, WeakLink is no longer specific to a target type. The reason for this is that we want to be able to safely convert e.g. WeakPtr<T> to WeakPtr<U>, and before this we just reinterpret_cast the internal WeakLink<T> to WeakLink<U>, which is a bold assumption that it would actually produce the correct code. Instead, WeakLink now operates on just a raw pointer and we only make those constructors/operators available if we can verify that it can be safely cast. In order to guarantee thread safety, we now use the least significant bit in the pointer for locking purposes. This also means that only properly aligned pointers can be used.
2020-11-08LibGUI+WindowServer: Make DragOperation hold a MimeData instanceAnotherTest
...instead of maybe bitmap + a single mime type and its corresponding data. This allows drag&drop operations to hold multiple different kinds of data, and the views/applications to choose between those. For instance, Spreadsheet can keep the structure of the dragged cells, and still provide text-only data to be passed to different unrelated editors.
2020-11-02WindowServer+LibGfx: Add Gfx::StandardCursor::Hidden cursorBrendan Coles
2020-10-30WindowServer+LibGfx: Added Crosshair cursorUma Sankar Yedida
2020-10-27LibGUI+LibGfx+WindowServer: Auto-generate disabled action icons :^)Andreas Kling
This patch adds a simple filter that makes button and menu item icons have that "'90s disabled" look when disabled. It's pretty awesome.
2020-10-27WindowServer: Improve look of drag&drop items somewhatAndreas Kling
This just adds a bit of padding around items. There's lots of room for improvement here.
2020-10-25WindowServer: Raise menu item icons slightly when hovered :^)Andreas Kling
Same effect as LibGUI toolbar buttons.
2020-10-24LibGfx+WindowServer: Handle taller window title fonts betterAndreas Kling
If the window title font is taller than the theme's specified title height, compute the title height based on the font instead. :^)
2020-10-20WindowServer: Return some event members by const referenceAndreas Kling
2020-10-05Services: Remove unused includes of {LibCore,WindowServer}/EventLoop.hNico Weber
2020-10-03Everywhere: Fix more typosLinus Groh
2020-09-25Meta+Services: Make clang-format-10 cleanBen Wiederhake
2020-09-19WindowServer: Shrink menubar menu text rects slightlyAndreas Kling
We don't want the menu titles to cover the entire menubar.
2020-09-16WindowServer: Make SetWindowTaskbarRect tolerant to non-existing windowsTom
There is a window between windows disappearing (e.g. closing or crashes) and the Taskbar process being notified. So it is entirely possible that it may call SetWindowTaskbarRect() for a window and/or client id that no longer exists. As the Taskbar process does not own these windows, this should not be treated as a misbehaving application request. Instead, just silently ignore the request. The Taskbar will be notified shortly after that the window no longer exist and remove it from its list. Fixes #3494
2020-09-12LibIPC: Share most of the code between {Client,Server}ConnectionAndreas Kling
This patch introduces IPC::Connection which becomes the new base class of ClientConnection and ServerConnection. Most of the functionality has been hoisted up to the base class since almost all of it is useful on both sides. This gives us the ability to send synchronous messages in both directions, which is needed for the WebContent server process. Unlike other servers, WebContent does not mind blocking on a response from its client.
2020-09-11LibGUI+WindowServer: Rename window "override cursor" to just "cursor"Andreas Kling
Let's just say each window has a cursor, there's not really overriding going on.
2020-09-10LibGfx: Move StandardCursor enum to LibGfxAndreas Kling
This enum existed both in LibGUI and WindowServer which was silly and error-prone.
2020-09-08WindowServer: Draw minimize animation invertedTom
Inverting the pixels makes the animation visible over most colors.
2020-09-07WindowServer: Fix invalidating window frameTom
When invalidating the frame we need to properly flag that so that we trigger rendering the frame, even if "all" was flagged as being invalidated. Otherwise it will only get rendered if anything else happens to trigger it (such as focus change). Fixes #3427
2020-08-31WindowServer: Return correct IsMaximized responsethankyouverycool