summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/ConnectionFromClient.cpp
AgeCommit message (Collapse)Author
2023-06-01WindowServer: Don't crash when trying to set invalid effectsBen Wiederhake
2023-05-15WindowServer: Catch more Window stealing misbehaviorthankyouverycool
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.
2023-04-19WindowServer+LibGUI: Port WindowServer's Menu name to new StringKarol Kosek
2023-04-18WindowServer: Show complete title when Window is not resizablethankyouverycool
Saves Dialogs the trouble of accounting for variable width titles and makes all unresizable windows more responsive to font changes.
2023-04-13WindowServer: Implement tile window overlayTom
This adds a tiling mode that will show a tile window overlay rather than immediately tiling a window, triggering window resizes.
2023-03-26WindowServer: Allow updating the name of a menuMacDue
2023-03-26WindowServer: Rename menu_title to name in IPC APIMacDue
This is referred to as the name everywhere else, so we should be consistent here.
2023-03-10Everywhere: Support overriding the system color schemeimplicitfield
2023-02-13LibCore: Move Stream-based sockets into the `Core` namespaceTim Schumacher
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-17LibGUI+WindowServer: Improve window resizing performanceJelle Raaijmakers
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%.
2023-01-12LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOrSam Atkins
clang-format sure has some interesting opinions about where to put a method call that comes after a lambda. :thonk:
2023-01-03WindowServer: Write new config to disk when system fonts are changedAndreas Kling
This makes system font changes actually persist across reboots.
2023-01-03WindowServer: Only load /etc/WindowServer.ini once and keep it loadedAndreas Kling
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.
2022-12-28LibGfx+Overall: Remove `is_null` from `Point`, `Rect` and `Size`Jelle Raaijmakers
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.
2022-12-23WindowServer: Remove overcropping for magnifierFrHun
This function is only used by the magnifier currently. Since we now apply the scaling factor in Bitmap::cropped(), this is not necessary anymore.
2022-12-23WindowServer: Allow overriding position when getting bitmapFrHun
2022-12-11WindowServer: Include missing visibility argument when making MenuItemthankyouverycool
Fixes checkable MenuItems drawing incorrectly due to shifted defaults.
2022-12-10LibGUI+WindowServer: Add "visible" state to GUI actionsAndreas Kling
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! :^)
2022-12-08WindowServer+MouseSettings: Improve `buttons_switched` namingFiliph Sandström
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.
2022-12-07Meta+Userland: Pass Gfx::IntSize by valueMacDue
Just two ints like Gfx::IntPoint.
2022-12-07Meta+Userland: Pass Gfx::IntPoint by valueMacDue
This is just two ints or 8 bytes or the size of the reference on x86_64 or AArch64.
2022-12-07Meta+Userland: Pass Gfx::Color by valueMacDue
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.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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 :^)
2022-12-04WindowServer: Add "Natural scrolling" supportFiliph Sandström
Also commonly referred to as "reverse scrolling" or "inverted scrolling".
2022-11-19WindowServer: Add misbehavior restriction for Blocking modalsthankyouverycool
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.
2022-11-19Everywhere: Remove unnecessary mutable attributes from lambdasMacDue
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.
2022-11-02LibGUI+WindowServer: Allow programatically minimizing windowsTimothy Flynn
The backend methods in WindowServer already exist. This just adds the IPC plumbing to connect those methods to GUI::Window.
2022-10-22LibGfx: Make `Rect<T>` methods work when `T` is not `int` or `float`Sam Atkins
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>
2022-10-14WindowServer: Avoid `window` nullptr exceptionleeight
If `window` is nullptr, we should return as soon as possible to avoid segment fault runtime error.
2022-10-13LibGUI+WindowServer: Add Window::set_always_on_top()demostanis
2022-10-11WindowServer+LibGUI: Shrink window edge resize hot-spotsMart G
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.
2022-09-08Browser+LibGUI+WindowServer: Open Button menus uniformlythankyouverycool
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.
2022-08-31WindowServer+LibGUI: Change cursor icon if DragEnter event was acceptedKarol Kosek
2022-08-28WindowServer: Remove misbehavior conditions for modalsthankyouverycool
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.
2022-08-26WindowServer: Ignore modal blocking if capturing inputthankyouverycool
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.
2022-08-25LibGUI+WindowServer+Apps: Replace Accessory Windowsthankyouverycool
with the CaptureInput WindowMode. This mode will serve the same function as accessories: redirecting input while allowing parent windows to remain active.
2022-08-25LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindowsthankyouverycool
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.
2022-08-25LibGUI+WindowServer: Introduce WindowModesthankyouverycool
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.
2022-08-25WindowServer: Remove nudge_into_desktop() from Windowthankyouverycool
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.
2022-08-25LibGUI+WindowServer: Initialize minimum window size to zerothankyouverycool
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.
2022-08-21WindowServer: Redraw menu items after client updates them somehowAndreas Kling
This fixes an issue where the undo/redo actions in TextEditor only updated once you hovered over them.
2022-08-16WindowServer: Don't start a drag and drop unless holding Primary mousethankyouverycool
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.
2022-08-09LibGUI+WindowServer: Create IPC calls for passing SystemEffectsthankyouverycool
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.
2022-08-02WindowServer+LibGUI: Remove awkward roundtrip for set wallpaper responsenetworkException
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.
2022-08-01Userland+Base: Make the window titlebar font configurable separatelyAndreas Kling
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.
2022-07-27WindowServer: Ensure windows are wide enough to show title buttons :^)Sam Atkins
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.
2022-06-17WindowServer: Allow temporarily overriding the system themenetworkException
This patch adds a new api to override the current system theme with an in memory override theme.
2022-06-05WindowServer: Add IPC calls for changing the cursor highlightingMacDue
2022-06-01LibGUI+WindowServer: Propagate action icon changes to buttons and menusnetworkException
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.