summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer
AgeCommit message (Collapse)Author
2022-05-05Everywhere: Purge all support and usage of framebuffer devicesLiav A
Long live the DisplayConnector object!
2022-05-05Everywhere: Rename fb prefix function names => graphics_connectorLiav A
2022-05-05Everywhere: Rename FB prefix structure names => GraphicsLiav A
2022-05-05WindowServer: Use FB_IOCTL_FLUSH_HEAD to flush a framebuffer if possibleLiav A
This ioctl is more appropriate when the hardware supports flushing of the entire framebuffer, so we use that instead of the previous default FB_IOCTL_FLUSH_HEAD_BUFFERS ioctl.
2022-05-05WindowServer: Implement mechanism to restore safe mode settingLiav A
Such mechanism will be used by the Intel Graphics driver, because we lack support of changing the resolution on this driver currently, so, when WindowServer will try to mode-set the display then it will fail, and will use the safe mode-setting call instead to be able to show something on screen.
2022-05-05DisplaySettings+WindowServer: Add support for display connector devicesLiav A
2022-05-03WindowServer: Support hover icons for title buttonsMacDue
This allows adding "-hover.png" variants of the title button icons. This can be useful for themes which use the TitleButtonsIconOnly flag, which otherwise don't have a way of showing the hover state.
2022-04-29Kernel+WindowServer: Move setting tty graphical mode to UserspacePeter Elliott
This will allow using the console tty and WindowServer regardless of your kernel command line. Also this fixes a bug where, when booting in text mode, the console was in graphical mode, and would not accept input.
2022-04-25LibGfx+WindowServer: Add theme flag TitleButtonsIconOnlyMacDue
With this flag set to true only the icon of the title button is painted. This is useful for themes with a more non-serenity look such as Coffee and Cupertino (that currently try to hide the button).
2022-04-21WindowServer: Create the VirtualScreenBackendkleines Filmröllchen
This screen backend is just memory-backed and doesn't connect to any screen hardware. That way, we can boot Serenity without video hardware but in full graphical mode :^) To create a virtual screen, put something like this in your WindowServer.ini. There's no way yet to do this through Display Settings, though an existing virtual screen's settings can be changed there. ```ini [Screen0] Mode=Virtual Left=1024 Top=0 Width=1920 Height=1080 ScaleFactor=1 ```
2022-04-21WindowServer: Add the screen mode property in the screen configurationkleines Filmröllchen
This will allow us to change between a couple of properties, for now it's only Device and Virtual. (How about Remote :^) ) These get handled by a different screen backend in the Screen.
2022-04-21WindowServer: Make Screen use ScreenBackendkleines Filmröllchen
This will allow us to use other screen backends in the future instead.
2022-04-21WindowServer: Introduce the ScreenBackend conceptkleines Filmröllchen
The ScreenBackend is a thin wrapper around the actual screen hardware connection. It contains all the variables specific to that hardware and abstracts away operations that deal with controlling the hardware. The standard ScreenBackend implementor is HardwareScreenBackend, which contains all the existing frame buffer & ioctl handling code of Screen. I took this opportunity to introduce ErrorOr wherever sensible.
2022-04-21WindowServer: Rename fb_data and friends to flush_rect etckleines Filmröllchen
This was very badly named. All that the "FBData" struct contains is the currently to-be-flushed rectangles plus a fullness flag, so it should better be called FlushRectData. This rename is similarly applied to all variable names.
2022-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-04-05WindowServer+LibGUI: Notify windows when their maximized state changesAndreas Kling
Previously, GUI::Window::is_maximized() had to make a synchronous IPC request to WindowServer in order to find out if the window was indeed maximized. This patch removes the need for synchronous IPC by instead pushing the maximization state to clients when it changes. The motivation for this change was that GUI::Statusbar was checking if the containing window was maximized in its resize_event(), causing all windows with a statusbar to block on sync IPC *during* resize. Browser would typically block for ~15 milliseconds here every time on my machine, continuously during live resize.
2022-04-03DisplaySettings+WindowServer: Allow updating theme without backgroundBen Maxwell
With this change you can now set the theme and background color at the same time in the Display Settings. Before if both were changed before hitting 'apply' the theme background color would overwrite the custom background.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-27WindowServer+LibGUI: Expose raw scroll wheel values to applicationscircl
This is useful, for instance, in games in which you can switch held items using the scroll wheel. In order to implement this, they previously would have to either add a hard-coded division by 4, or look up your mouse settings to adjust correctly. This commit adds an MouseEvent.wheel_raw_delta_x() and MouseEvent.wheel_raw_delta_y().
2022-03-24Services: Use default constructors/destructorsLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-18WindowServer: Fix animation crashTom
If an Animation's on_stop handler cleared itself inside the on_stop event handler, it would remove itself from the animation map that was still being iterated, leading to a crash. To solve this, we'll iterate over the animations using the remove_all_matching function, which enables us to delete it by simply returning true when the animation finished. In the event that the Animation is kept alive elsewhere and the on_stop event clears its own reference, we need to temporarily bump the reference count. Another advantage is that we only need to bump the reference count when an animation is finished, whereas before this we bumped it unconditionally.
2022-03-18Userland: Change static const variables to static constexprLenny Maiorani
`static const` variables can be computed and initialized at run-time during initialization or the first time a function is called. Change them to `static constexpr` to ensure they are computed at compile-time. This allows some removal of `strlen` because the length of the `StringView` can be used which is pre-computed at compile-time.
2022-03-14WindowServer: Update menu buttons' rects on font changeKarol Kosek
Prior to this change, after changing the system font, the menu rects stayed the same, making the menu bar look a bit cramped on larger fonts.
2022-03-14WindowServer: Use font height for item heights in MenusKarol Kosek
The height of menu items was relatively small on larger fonts.
2022-03-04LibGfx: Rename RGBA32 => ARGB32Andreas Kling
The ARGB32 typedef is used for 32-bit #AARRGGBB quadruplets. As such, the name RGBA32 was misleading, so let's call it ARGB32 instead. Since endianness is a thing, let's not encode any assumptions about byte order in the name of this type. ARGB32 is basically a "machine word" of color.
2022-03-04Libraries: Make CharacterBitmap instances at compile-timeLenny Maiorani
`CharacterBitmap` instances are generated at run-time and put on the heap, but they can be created in a `constexpr` context and stored in static memory. Also, remove additional `width` and `height` `static` values in favor of using the `constexpr` member functions of `CharacterBitmap`. These changes also include the removal of some initialization code which tests if the `CharacterBitmap` is created since it is always created and removes function-local `static` values which cause run-time branches to ensure it is initialized each time the function is called.
2022-03-02WindowServer: Treat window frames with a border radius as transparentMacDue
Without this, there are repainting artefacts when the window is moved.
2022-03-02WindowServer: Disable shadow rendering for themes with a border-radiusMacDue
The current shadow renderer only works for purely rectangular windows, when enabled with border radiuses the corners are wrong.
2022-02-25Userland: Rename WindowServerConnection=>ConnectionToWindowServerItamar
This was done with CLion's automatic rename feature.
2022-02-25Userland: Rename IPC ClientConnection => ConnectionFromClientItamar
This was done with CLion's automatic rename feature and with: find . -name ClientConnection.h | rename 's/ClientConnection\.h/ConnectionFromClient.h/' find . -name ClientConnection.cpp | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
2022-02-24LibGUI+WindowServer: Add new `WMEvent` Super+DigitJan Grau
This adds a keyboard event for Super+0 to Super+9. Later to be consumed in the taskbar. Currently only this keyboard sequence is supported: - Super key down - Digit key down But not this: - Super key down - Digit key down - Digit key up - Digit key down
2022-02-21WindowServer: Mark window frame as invalidated when updating titleTom
We need to set Window::m_invalidated_frame to true when invalidating the title, otherwise we may miss re-rendering the frame if nothing else triggers it.
2022-02-21WindowServer: Add IPC call to remove a menu's itemMarco Cutecchia
2022-02-16LibCore+Everywhere: Return ErrorOr from ConfigFile::sync()Sam Atkins
Currently this method always succeeds, but that won't be true once we switch to the Core::Stream API. :^) Some of these places would ideally show an error message to the user, since failure to save a file is significant, but let's not get distracted right now.
2022-02-16LibCore+Everywhere: Return ErrorOr from ConfigFile factory methodsSam Atkins
I've attempted to handle the errors gracefully where it was clear how to do so, and simple, but a lot of this was just adding `release_value_but_fixme_should_propagate_errors()` in places.
2022-02-14WindowServer: Remove extraneous whitespace in `WindowServer.ipc`James Puleo
2022-02-14WindowServer+Userland: Pass wallpapers as `Gfx::Bitmap` instead of pathJames Puleo
The WindowServer _really_ does not need to know the filesystem path to it's wallpaper, and allows setting arbitrary wallpapers (those outside of `/res/wallpapers`). The GUI::Desktop will keep track of the path to the wallpaper (if any), and save it to config if desired (to be persisted). This avoids the need to `unveil` paths to the wallpaper, fixing #11158
2022-02-14WindowServer: Consolidate tiled and maximized window rects calculationVitaly Dyachkov
Calculating tiled and miximized window frame have a lot in common. In fact, we can look at maximized window state as a special case of the tile type. It simplifies the code since there is a lot of cases when we take an action only if the window is maximized or tiled.
2022-02-08WindowServer: Preserve cursor position when dragging between statesthankyouverycool
Previously windows would end up in awkward positions relative to the move cursor when dragging between tile types or unmaximizing. This feels a bit more ergonomic.
2022-02-08WindowServer: Add Vertically/HorizontallyMaximized WindowTileTypesthankyouverycool
VerticallyMaximized tiling replaces set_vertically_maximized() to take advantage of tiling ergonomics. Middle-clicking a window's maximize button now tiles vertically; secondary-clicking tiles horizontally. Adds Super+Alt+Arrow shortcuts for both. Super+Left/Right tiling shortcuts now let windows shift between tile types directly.
2022-02-08WindowServer: Fix comments in WindowManagerthankyouverycool
2022-02-08WindowServer: Unify Window restore rectsthankyouverycool
Previously, different rects were used to restore tiled and maximized windows, creating edge cases for inconsistent restoration. All states now restore m_floating_rect, which saves the last valid size and location of a window while free-floating.
2022-02-08WindowServer: Rename Window::tiled() => tile_type() and add is_tiled()thankyouverycool
This seems more consistent with naming conventions across the system and makes conditionals easier to read.
2022-02-03Base+WindowsServer+keymap: Store multiple keymaps in a configTimur Sultanov
2022-02-03WindowServer+Keymap+LibGUI: Add widget to display current keymapTimur Sultanov
2022-02-03WindowManager: Basic support for system keymap switchingTimur Sultanov
2022-02-01Everywhere: Fully qualify font names by including their slopethankyouverycool
Fixes typefaces of the same weight but different slopes being incorrectly returned for each other by FontDatabase.
2022-01-29WindowServer: Allow checking checkable entries in a menu using spacenetworkException
2022-01-25WindowServer: Rename default_positioned() -> is_default_positioned()Valtteri Koskivuori
Tiny change, but it really bothered me that this was the only function not named like the rest.
2022-01-23WindowServer: Paint menu checkboxes as such instead of as framesthankyouverycool
Fixes disabled checkboxes appearing enabled in menus.