summaryrefslogtreecommitdiff
path: root/Servers
AgeCommit message (Collapse)Author
2019-12-27WindowServer+LibGUI: Mark window bitmaps volatile in occluded windowsAndreas Kling
WindowServer now tracks whether windows are occluded (meaning that they are completely covered by one or more opaque windows sitting above them.) This state is communicated to the windows via WindowStateChanged messages, which then allow GWindow to mark its backing store volatile. This reduces the effective memory impact of windows that are not at all visible to the user. Very cool. :^)
2019-12-26LibGUI+WindowServer: Mark minimized window backing stores as volatileAndreas Kling
WindowServer will now send out a WindowStateChanged message to clients when one of their windows is minimized. This is then forwarded to the GWindow, which will try to mark its underlying window backing store as volatile. This allows the kernel to steal the memory used by minimized windows in case it starts running low. Very cool! :^)
2019-12-26LibDraw: Add MenuBaseText and MenuSelectionText color rolesAndreas Kling
This allows the very aesthetic "Hotdog Stand" theme to have quite reasonable looking menus.
2019-12-25AudioServer: Block the mixer thread when there's nothing to doAndreas Kling
Use a pthread_cond_t to have the ASMixer thread wait until a client has connected and added a buffer queue to the "pending mixing" vector. This solves the long-standing issue of the system "idling" at ~8% CPU.
2019-12-25Build: support library and generator dependenciesjoshua stein
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each subdirectory Makefile listing the libraries needed for building/linking such as "LIB_DEPS = Core GUI Draw IPC Core". This adds each library as an -L and -l argument in LDFLAGS, but also adds the library.a file as a link dependency on the current $(PROGRAM). This causes the given library to be (re)built before linking the current $(PROGRAM), but will also re-link any binaries depending on that library when it is modified, when running make from the root directory. Also turn generator tools like IPCCompiler into dependencies on the files they generate, so they are built on-demand when a particular directory needs them. This all allows the root Makefile to just list directories and not care about the order, as all of the dependency tracking will figure it out.
2019-12-24LibGUI+LibDraw: Add "Palette" concept for scoped color themingAndreas Kling
GApplication now has a palette. This palette contains all the system theme colors by default, and is inherited by a new top-level GWidget. New child widgets inherit their parents palette. It is possible to override the GApplication palette, and the palette of any GWidget. The Palette object contains a bunch of colors, each corresponding to a ColorRole. Each role has a convenience getter as well. Each GWidget now has a background_role() and foreground_role(), which are then looked up in their current palette when painting. This means that you no longer alter the background color of a widget by setting it directly, rather you alter either its background role, or the widget's palette.
2019-12-24LibDraw: Add Selection and SelectionText system theme colorsAndreas Kling
2019-12-24LibDraw: Add Button and ButtonText system theme colorsAndreas Kling
These are now separate from the Window and WindowText colors.
2019-12-24WindowServer: Paint window frame button symbols in SystemColor::TextAndreas Kling
2019-12-23WindowServer+LibGUI: Implement basic color themingAndreas Kling
Color themes are loaded from .ini files in /res/themes/ The theme can be switched from the "Themes" section in the system menu. The basic mechanism is that WindowServer broadcasts a SharedBuffer with all of the color values of the current theme. Clients receive this with the response to their initial WindowServer::Greet handshake. When the theme is changed, WindowServer tells everyone by sending out an UpdateSystemTheme message with a new SharedBuffer to use. This does feel somewhat bloated somehow, but I'm sure we can iterate on it over time and improve things. To get one of the theme colors, use the Color(SystemColor) constructor: painter.fill_rect(rect, SystemColor::HoverHighlight); Some things don't work 100% right without a reboot. Specifically, when constructing a GWidget, it will set its own background and foreground colors based on the current SystemColor::Window and SystemColor::Text. The widget is then stuck with these values, and they don't update on system theme change, only on app restart. All in all though, this is pretty cool. Merry Christmas! :^)
2019-12-22AudioServer: Remove any pending mixer queues whose client disconnectedAndreas Kling
We were pumping the sound device full of silence even after the last audio client disconnected.
2019-12-20Build: clean up build system, use one shared Makefilejoshua stein
Allow everything to be built from the top level directory with just 'make', cleaned with 'make clean', and installed with 'make install'. Also support these in any particular subdirectory. Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as it runs. Kernel and early host tools (IPCCompiler, etc.) are built as object.host.o so that they don't conflict with other things built with the cross-compiler.
2019-12-20WindowServer: Starting a drag should forget the active input windowAndreas Kling
When we're in a drag, we're no longer concerned with streaming mouse events to the window that initiated the drag, so just clear the active input window pointer. This fixes an issue where you'd have to click once after drag and drop in order to "release" the mouse from the active input window.
2019-12-20WindowServer+LibGUI: Add data_type and data fields to drag operationsAndreas Kling
These fields are intended to carry the real meat of a drag operation, and the "text" is just for what we show on screen (alongside the cursor during the actual drag.) The data field is just a String for now, but in the future we should make it something more flexible.
2019-12-16WindowServer: Stop linking with LibAudioAndreas Kling
This is no longer necessary, since the audio applet has been moved to its own process.
2019-12-16WindowServer+MenuApplets: Move the "Audio" applet to its own programAndreas Kling
This patch introduces the second MenuApplet: Audio. To make this work, menu applet windows now also receive mouse events. There's still some problem with mute/unmute via clicking not actually working, but the call goes from the applet program over IPC to the AudioServer, where something goes wrong with the state change message. Need to look at that separately. Anyways, it's pretty cool to have more applets running in their own separate processes. :^)
2019-12-16WindowServer+CPUGraph: Make menu applets be "regular" windowsAndreas Kling
Instead of implementing menu applets as their own thing, they are now WSWindows of WSWindowType::MenuApplet. This makes it much easier to work with them on the client side, since you can just create a GWindow with the right type and you're in the menubar doing applet stuff :^)
2019-12-15WindowServer: Fix MenuManager item postitions after screen resolution change.Hüseyin ASLITÜRK
2019-12-09AK: Use size_t for the length of stringsAndreas Kling
Using int was a mistake. This patch changes String, StringImpl, StringView and StringBuilder to use size_t instead of int for lengths. Obviously a lot of code needs to change as a result of this.
2019-12-09WindowServer: Fix typo in drag&drop cursor rect computation :^) (#863)Kevin Murphy
2019-12-08WindowServer: Disambiguate "dragging" a bit, use "moving" more insteadAndreas Kling
Windows that are being moved around by the user are now called "moving" windows instead of "dragging" windows, to avoid confusion with the drag and drop stuff.
2019-12-08WindowServer: Add a dedicated drag cursorAndreas Kling
2019-12-08LibGUI+WindowServer: Allow specifying an optional drag bitmapAndreas Kling
This bitmap is displayed alongside the dragged text underneath the mouse cursor while dragging. This will be a perfect fit for dragging e.g files around. :^)
2019-12-08LibGUI+WindowServer: Start fleshing out drag&drop functionalityAndreas Kling
This patch enables basic drag&drop between applications. You initiate a drag by creating a GDragOperation object and calling exec() on it. This creates a nested event loop in the calling program that only returns once the drag operation has ended. On the receiving side, you get a call to GWidget::drop_event() with a GDropEvent containing information about the dropped data. The only data passed right now is a piece of text that's also used to visually indicate that a drag is happening (by showing the text in a little box that follows the mouse cursor around.) There are things to fix here, but we're off to a nice start. :^)
2019-12-08AudioServer: Set the mixer thread name to "AudioServer[mixer]"Andrew Kaster
2019-12-08AudioServer: Install headersAndreas Kling
2019-12-06LibIPC: Get client/server PIDs using getsockopt(SO_PEERCRED)Andreas Kling
Instead of passing the PIDs back and forth in a handshake "Greet" message, just use getsockopt(SO_PEERCRED) on both sides to get the same information from the kernel. This is a nice little simplification of the IPC protocol, although it does not get rid of the handshake since we still have to pass the "client ID" from the server to each client so they know how to refer to themselves. This might not be necessary and we might be able to get rid of this later on.
2019-12-05WindowServer: Compute some layout rects in WSMenuManager up frontAndreas Kling
Currently menu applets are laid out relative to the "audio rect" which is the rect of the little audio muted state icon thingy. There was an issue where applets would be placed at a negative X coord if they were added to the WindowServer before the first time drawing the menubar.
2019-12-05WindowServer: Remove WSCPUMonitorAndreas Kling
We'll still have a CPU graph, just not in the WindowServer process.
2019-12-05WindowServer: Add basic menu applet conceptAndreas Kling
It's now possible to create a little applet window that sits inside the system's menubar. This is done using the new CreateMenuApplet IPC call. So far, it's possible to assign a backing store ID, and to invalidate rects for repaint. There is no way to get the events from inside the applet just yet. This will allow us to move the CPU graph and audio thingy to separate applet processes. :^)
2019-12-05WindowServer: Move window minimize animation to a separate functionAndreas Kling
Move this from WSCompositor::compose() to a separate run_animations() function to keep compose() readable. We might want to add some more animations later.
2019-12-03WindowServer+Taskbar: Animate window frames on minimize/unminimizeAndreas Kling
We now show a quick window outline animation when going in/out of minimized state. It's a simple 10 frame animation at 60fps, just to give a visual cue of what's happening with the window. The Taskbar sends over the corresponding button rect for each window to the WindowServer using a new WM_SetWindowTaskbarRect message. Note that when unminimizing, we still *show* the window right away, and don't hold off until the animation has finished. This avoids making the desktop feel slow/sluggish. :^)
2019-12-02WindowServer: Remove debug spam about menu creationAndreas Kling
2019-12-02WindowServer: Remove silly debug logging on startup :^)Andreas Kling
2019-12-02WindowServer: Mark clients as misbehaving when they send invalid dataAndreas Kling
If a client sends an invalid window ID or similar to the WindowServer, we'll now immediately mark them as misbehaving and disconnect them. This might be too aggressive in some cases (window management, ...) but it's just a place to start.
2019-12-02LibIPC: Rename base classes to IClientConnection and IServerConnectionAndreas Kling
This matches what we're already calling the server-side subclasses better, though we'll probably want to find some better names for the client-side classes eventually.
2019-12-02LibIPC: Move IPC client/server connection templates to LibIPCAndreas Kling
Move over the CoreIPC::Server and CoreIPC::Client namespace stuff into LibIPC where it will soon becomes LibIPC-style things.
2019-12-02WindowServer: Port to the new IPC systemAndreas Kling
This patch introduces code generation for the WindowServer IPC with its clients. The client/server endpoints are defined by the two .ipc files in Servers/WindowServer/: WindowServer.ipc and WindowClient.ipc It now becomes significantly easier to add features and capabilities to WindowServer since you don't have to know nearly as much about all the intricate paths that IPC messages take between LibGUI and WSWindow. The new system also uses significantly less IPC bandwidth since we're now doing packed serialization instead of passing fixed-sized structs of ~600 bytes for each message. Some repaint coalescing optimizations are lost in this conversion and we'll need to look at how to implement those in the new world. The old CoreIPC::Client::Connection and CoreIPC::Server::Connection classes are removed by this patch and replaced by use of ConnectionNG, which will be renamed eventually. Goodbye, old WindowServer IPC. You served us well :^)
2019-12-01WindowServer: Remove unused GetWindowBackingStore IPC requestAndreas Kling
2019-11-30ProtocolServer: Don't crash on failed requestAndreas Kling
The CNetworkJob::on_finish hook will be invoked both for success and failure, but there will only be a m_job->response() in the success case so we have to null-check it before using it. This should have been obvious from the "->"
2019-11-26Kernel: Expose per-thread information in /proc/allAndreas Kling
Previously it was not possible to see what each thread in a process was up to, or how much CPU it was consuming. This patch fixes that. SystemMonitor and "top" now show threads instead of just processes. "ps" is gonna need some more fixing, but it at least builds for now. Fixes #66.
2019-11-26SystemServer: Implement lazy spawningSergey Bugaev
For services explicitly configured as lazy, SystemServer will now listen on the socket and only spawn the service once a client attempts to connect to the socket.
2019-11-26LookupServer: Port to socket takeoverSergey Bugaev
2019-11-26LookupServer: Port to LibCoreSergey Bugaev
2019-11-26ProtocolServer: Port to socket takeoverSergey Bugaev
2019-11-26AudioServer: Port to socket takeoverSergey Bugaev
2019-11-26WindowServer: Port to socket takeoverSergey Bugaev
2019-11-26SystemServer+LibCore: Implement socket takeoverSergey Bugaev
SystemServer can now create sockets on behalf of services before spawning any of them, and pass the open socket fd as fd 3. CLocalServer gains a method to complete the takeover and listen on the passed fd. This is not used by any services at the moment.
2019-11-26SystemServer: Implement keepaliveSergey Bugaev
When reaping a child, SystemServer will now match up child's pid with its own record of the services, and respawn the service if keepalive is enabled for it. For example, we want to restart the WindowServer if it crashes, but we wouldn't want to restart the Terminal if it gets closed.
2019-11-26SystemServer: Read service list from a config fileSergey Bugaev
This replaces the hardcoded services list with a very simple config file in /etc/SystemServer.ini :^) Closes https://github.com/SerenityOS/serenity/issues/610