Commit graph

574 commits

Author SHA1 Message Date
Shannon Booth
238b6871e0 WindowServer: Fix not all menus closing after system menu toggle
We were failing to check if the current menu being set was already open.
This could result in multiple occurrences of the menu in the open menu stack.

When we close all menus descending from a menu we only delete the first
occurrence of a given menu from the menu stack (a fair assumption to make as
a menu should only be open once).

Because of this a menu (or multiple instances of it) could remain in the open
menu stack when it should actually be closed, leading to goofy behaviour.

Fixes #1238
2020-02-20 15:11:31 +01:00
Tibor Nagy
bbfefb8827 WindowServer: Geometry labels should follow the system theme 2020-02-20 14:19:30 +01:00
Tibor Nagy
1da3be82ad WindowServer: MenuManager should use selection text color from system theme 2020-02-20 14:19:30 +01:00
Andreas Kling
eaa680ab8e WindowServer+LibGUI: Force full window repaints after theme change
We were not repainting windows that were occluded at the time of the
theme changing. This patch adds a way to bypass occlusion testing when
invalidating window rects.

Fixes #1249.
2020-02-19 16:46:28 +01:00
Andreas Kling
ef38c49619 WindowServer+LibGUI+LibHTML: Fix build with -std=c++2a 2020-02-19 12:03:01 +01:00
Andreas Kling
a31ca1282e Base: Rename /dev/psaux to /dev/mouse
Since this device doesn't actually hand out raw PS/2 aux packets,
let's just call it "mouse" instead. :^)
2020-02-18 14:30:39 +01:00
Shannon Booth
52c76aa9bf WindowServer: Remove unsued MenuManager::menu_selection_color() 2020-02-18 09:42:02 +01:00
Andreas Kling
2060da829c WindowServer: Remove unveils of /bin and /etc/passwd
This is no longer needed now that we have SystemMenu. :^)
2020-02-17 20:20:46 +01:00
Andreas Kling
a008e2f63a WindowServer: Drop the "exec" pledge promise entirely
Now that the system menu is out-of-process, we no longer need to exec()
from WindowServer, allowing us to drop this promise. Very cool!
2020-02-17 20:20:46 +01:00
Andreas Kling
84520d8b59 WindowServer: Make way for the out-of-process system menu
This patch removes the internal system menu from WindowServer and
replaces it with two IPC API's:

    SetSystemMenu(menu_id)
    SetSystemTheme(theme_path, theme_name)

These API's will allow us to complete the SystemMenu program and
move it entirely out of process.
2020-02-17 20:08:00 +01:00
Andreas Kling
a0ad372b08 AudioServer: Remove ASEventLoop class and do all the setup in main()
This class was too small and unnecessary.
2020-02-17 16:50:48 +01:00
Andreas Kling
7efb497837 NotificationServer: Add new notification windows below the lowest one
Don't stack notifications on top of each other, instead put them below
one another on the y axis.

This will obviously break if the screen fills with notifications, but
that's a FIXME for now. :^)
2020-02-16 21:58:17 +01:00
Andreas Kling
9f54ea9bcd NotificationServer: Add a system service for desktop notifications
This patch adds NotificationServer, which runs as the "notify" user
and provides an IPC API for desktop notifications.

LibGUI gains the GUI::Notification class for showing notifications.

NotificationServer is spawned on demand and will unspawn after
dimissing all visible notifications. :^)

Finally, this also comes with a small /bin/notify utility.
2020-02-16 21:58:17 +01:00
Andreas Kling
a6e69bda71 AK: Add basic Traits for RefPtr
This allows RefPtr to be stored in a HashTable<RefPtr<T>> :^)

It's unfortunate about the const_casts. We'll need to fix HashMap::get
to play nice with non-const Traits<T>::PeekType at some point.
2020-02-16 21:58:17 +01:00
Andreas Kling
0415db30c6 WindowServer: Move configuration file into /etc/WindowServer
This is in preparation for running WindowServer as a separate user.
2020-02-16 21:58:17 +01:00
Andreas Kling
0e3a9d8e9d LibCore: Reduce header dependencies of EventLoop 2020-02-15 02:09:00 +01:00
Andreas Kling
69400c2ca1 LibCore: Replace manual forward declarations with <LibCore/Forward.h> 2020-02-15 00:13:44 +01:00
Andreas Kling
6a3cd11a80 AK: Remove manual forward declarations with <AK/Forward.h> 2020-02-15 00:12:31 +01:00
Andreas Kling
a368cf7d51 LibGfx: Replace manual forward declarations with <LibGfx/Forward.h> 2020-02-15 00:10:34 +01:00
Andreas Kling
3fe2640c8c LibGfx: Add forward declaration header
This patch adds <LibGfx/Forward.h> with forward declarations for Gfx.
2020-02-14 23:31:18 +01:00
Andreas Kling
8f7333f080 LibCore: Add a forward declaration header
This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
2020-02-14 23:31:18 +01:00
Andreas Kling
3bbf4610d2 AK: Add a forward declaration header
You can now #include <AK/Forward.h> to get most of the AK types as
forward declarations.

Header dependency explosion is one of the main contributors to compile
times at the moment, so this is a step towards smaller include graphs.
2020-02-14 23:31:18 +01:00
Andreas Kling
3ce80bec97 WindowServer+LibGUI: Add a "drag move" event
This allows windows/widgets to learn when something is being dragged
over them. They can then repaint themselves somehow to indicate that
they are willing to accept a drop.

Currently this is piggybacking somewhat on the mouse event mechanism
in WindowServer. I'm not sure that's the best design but it seemed
easier to do it this way right now.
2020-02-13 21:43:32 +01:00
Bogdan
7590270e13 WebServer: Ensure directory listing URLs end with a slash
We will now send a redirect (301) if a directory listing is requested and the
request URL doesn't end with a slash character. This makes relative file URLs
that we generate in directory listings actually work as expected.
2020-02-13 20:06:32 +01:00
Andreas Kling
fc562a3a93 WebServer: Remove debug spam in directory listing code 2020-02-13 08:52:24 +01:00
Andreas Kling
f767085eb6 WebServer: Escape HTML entities in path names in directory listings
I left a FIXME in here about implementing URL encoding.
2020-02-13 08:51:49 +01:00
Andreas Kling
deca1d8b77 WebServer: Show file size and modification time in directory listings
This exposed an issue with the unveil() implementation which currently
short-circuits path resolution for any path containing "/..". This will
cause the ".." entry to show up with a 1970-01-01 mtime for now. FIXME.

Also add some rulers and a nice little footer. :^)
2020-02-12 21:39:09 +01:00
Andreas Kling
083f3edcb0 WebServer: Add basic directory listings
If a directory does not have an index.html file, we will now generate
a directory listing HTML document for that directory on the fly. :^)
2020-02-12 21:18:04 +01:00
Shannon Booth
91a97f7a42 WindowServer: Move some menu related code into MenuManager
Shuffle around some menu related code from window manager into menu
manager. This still is not perfect, and results in a little more of the
window manager to be publically exposed - but this is another step
towards better seperation of concerns between menu and window manager.

We also move the mouse_event handling into a new function in menu manager
as event handling was beginning to become a bit chunky.
2020-02-12 09:19:20 +01:00
Andreas Kling
2c9d94c6b9 WebServer: Use Core::DateTime for logging timestamps 2020-02-11 19:43:40 +01:00
Andreas Kling
0e44fb8731 WebServer: Add copyright headers 2020-02-11 19:25:06 +01:00
Andreas Kling
193d7c5b19 WindowServer: Make some WindowSwitcher members private 2020-02-11 18:56:31 +01:00
Andreas Kling
cfa6e44131 WindowServer: Remove unused WindowManager::draw_window_switcher() 2020-02-11 18:55:16 +01:00
Andreas Kling
0f00e9a1c7 WindowServer: Draw a coolbar border around the hovered switcher item
This gives a small but nice indication that the switcher window list
items are clickable. :^)
2020-02-11 18:53:56 +01:00
Andreas Kling
4c620dea83 WindowServer: Update window switcher when moving window to front
If the window switcher is up when a window is made frontmost (usually
by clicking on it), the window will now become the selected window in
the switcher.

This still has a slight feeling of "hmm" but is definitely better than
what we had before.
2020-02-11 18:38:48 +01:00
Andreas Kling
ba135dc0c0 WindowServer: Allow clicking on windows in the window switcher
You can now switch between windows using your mouse to click them in
the window switcher. :^)
2020-02-11 18:28:45 +01:00
Shannon Booth
01cefa83aa WindowServer: Ensure on a menu key press invalid items are not hovered
Whenever a new menu item is hovered through a up or down key press, we
should always end up hovering a valid item.
2020-02-11 11:00:09 +01:00
Shannon Booth
cef3988e30 WindowServer: Assert that a window is not being set as empty 2020-02-11 11:00:09 +01:00
Shannon Booth
96bfbfca9b WindowServer: Remove unimplemented header function 2020-02-11 11:00:09 +01:00
Shannon Booth
97508844dc WindowServer: Use early return to reduce nesting 2020-02-11 11:00:09 +01:00
asliturk
077ef556a7 WindowServer: Move applet code from MenuManager to AppletManager.
Move applet logic to the own class. Remove applet code from MenuManager.
With new AppletManager applet order is configurable via WindowManager.ini file.
2020-02-10 18:33:28 +01:00
Andreas Kling
c45a5ff840 WebServer: Add missing space to HTTP error responses
Fixes #1200.
2020-02-09 17:05:29 +01:00
Andreas Kling
80703ef7d9 WebServer: Send the HTTP response headers in a single packet
This makes it easier to observe the protocol in packet logs.
2020-02-09 14:15:55 +01:00
Andreas Kling
efb694ecad WebServer: Tighten things up with pledge() and unveil() 2020-02-09 14:15:55 +01:00
Andreas Kling
6c752c15a2 WebServer: Implement a very basic HTTP server :^)
This server listens on port 8000 and serves HTML files from /www.
It's very simple and quite naive, but I think we can start here and
build our way to something pretty neat.

Work towards #792.
2020-02-09 14:15:55 +01:00
Hüseyin ASLITÜRK
9b5e0b6247 WindowServer: Remove username from MenuManager.
Now, we have UserName applet.
2020-02-09 10:37:35 +01:00
Andreas Kling
fc85d17322 TelnetServer: Protect the Client object during drain_socket()
If parsing a command causes us to disconnect the client, we have to
defer deletion of the Client object until we're done with the socket.
2020-02-08 19:12:52 +01:00
Andreas Kling
6cf49c23d4 WindowServer: Move some menu related functions to MenuManager 2020-02-07 12:12:42 +01:00
Sergey Bugaev
6bda3bd8da SystemServer: Limit service restarts
SystemServer will now track the number of restart attempts and the
run time of a service, and will also pay attention to its exit code.
If a service exits unsuccessfully and too quickly (in less than a
second), SystemServer will only attempt to restart it twice.

This means that if WindowServer crashes on startup, we will now see
just a few copies of the crash instead of the quickly scrolling log
flashing with colors :^)
2020-02-07 12:10:56 +01:00
Sergey Bugaev
960df8a62a WindowServer: Don't try to load unspecified icons
Some apps (looking at you, VisualBuilder) don't specify an icon
in their .af file, so WindowServer was trying to open an empty path.
That made it print a perror message to the log each time. Let's not
do that ^)
2020-02-07 12:10:56 +01:00