Commit Graph

192 Commits

Author SHA1 Message Date
Sergey Bugaev
4139838a93 Userland et al: Pledge sigaction when needed
* In some cases, we can first call sigaction()/signal(), then *not* pledge
  sigaction.
* In other cases, we pledge sigaction at first, call sigaction()/signal()
  second, then pledge again, this time without sigaction.
* In yet other cases, we keep the sigaction pledge. I suppose these could all be
  migrated to drop it or not pledge it at all, if somebody is interested in
  doing that.
2020-05-26 14:35:10 +02:00
Sergey Bugaev
c1a26f0b35 WindowServer: Don't crash when minimizing Eyes
Or any other window that globally tracks the mouse cursor.
2020-05-25 12:38:37 +02:00
Andreas Kling
897998017a ProtocolServer: Support request headers
You can now pass a dictionary of request headers when starting a new
download in ProtocolServer.

The HTTP and HTTPS protocol will include the headers in their requests.
2020-05-21 12:27:42 +02:00
Hüseyin ASLITÜRK
d18f6e82eb LibGUI: Replace up and down arrows with emoji 2020-05-20 13:40:24 +02:00
Andreas Kling
191073000e WindowServer: Remove WindowManager::invalidate(Window) API's
Instead, we now tell Windows to invalidate themselves. Window will then
pass on the requests to Compositor.

My basic idea here is that WindowManager should do window management,
dealing with incoming events, moving, resizing, etc. Compositor should
deal with painting the window stack in the right order with the least
amount of effort. :^)
2020-05-20 08:31:46 +02:00
Andreas Kling
10699b347f WindowServer: Move occlusion things from WindowManager to Compositor 2020-05-20 08:31:46 +02:00
Andreas Kling
ecea904ce9 WindowServer: Always send mouse events to the full-screen window
Full-screen mode is pleasantly exclusive, so we only need to send the
incoming mouse events to the active full-screen window.

This fixes an issue where clicking on the area normally covered by
the menubar while in full-screen mode would not send mouse events to
the full-screen window.
2020-05-19 18:14:19 +02:00
Andreas Kling
c1827d9766 WindowServer: Ignore overlap when compositing full-screen windows
Normally we walk the window stack to see if a given dirty rect is
covered by an opaque window. When the active window is full-screened,
we can skip this check and just unconditionally paint the window.

This fixes an issue where windows with higher inherent z-order (like
the taskbar and menu windows) would get cursor ghosting in them while
a normal window was full-screened.

Fixes #2289.
2020-05-19 17:59:13 +02:00
Andreas Kling
bc7bf727dd SystemMenu: Don't exit if the shutdown dialog is opened but cancelled
Previously opening the shutdown dialog and cancelling out of it would
cause SystemMenu to exit due to the exit-when-there-are-no-more-windows
mechanism in GUI::Application. Fix this by opting out of it.
2020-05-19 17:46:28 +02:00
Andreas Kling
efb3a34e43 SystemMenu: Rename PowerDialog => ShutdownDialog 2020-05-19 17:46:28 +02:00
Shannon Booth
195c1784ba WindowServer: Rename WindowManager wm_config() to config()
It looked a little silly with all of the callers saying wm.wm
2020-05-18 14:34:57 +02:00
Shannon Booth
d3eccf0409 WindowServer: Make some WindowManager member functions const 2020-05-18 14:34:57 +02:00
Shannon Booth
1048283186 WindowServer: Remove uneeded const_casts for getting a submenu 2020-05-18 14:34:57 +02:00
Shannon Booth
41471eb3ae WindowServer: Add const version of Menu::find_menu_by_id(int menu_id)
It's a little sad having two diferent versions of this function, but I
don't know of any better way to do it. This also gets rid of some const
casts down the line.
2020-05-18 14:34:57 +02:00
Shannon Booth
08064ed219 WindowServer: Add const qualified version of MenuItem::submenu() 2020-05-18 14:34:57 +02:00
Nicholas Hollett
3c5f75ed53 LaunchServer: Discover handlers from *.af files, allow launching based on a known handler
Adds metadata about apps for what file types and protocols they can
handle, then consumes that in the LaunchServer. The LaunchServer can
then use that to offer multiple options for what apps can open a given
URL. Callers can then pass back the handler name to the LaunchServer to
use an alternate app :)
2020-05-18 11:27:27 +02:00
AnotherTest
013cb76d77 LibGemini: Implement rendering text/gemini documents to HTML
This also sets Content-Type to whatever 'meta' contains on success, to
allow the browser to pick up what the document contains.
2020-05-17 16:35:42 +02:00
Andreas Kling
a4902e0eec ProtocolServer: Put everything in the ProtocolServer namespace 2020-05-17 16:33:09 +02:00
Conrad Pankoff
f2621f37a4 ProtocolServer: Attach downloads and their lifecycles to clients
Previously a download lived independently of the client connection it came
from. This was the source of several undesirable behaviours, including the
potential for clients to influence downloads they didn't start, and
downloads living longer than their associated client connections. Now we
attach downloads to client connections, which means they're cleaned up
automatically when the client goes away, and there's significantly less
risk of clients interfering with each other.
2020-05-17 12:41:38 +02:00
Conrad Pankoff
aaa6f90c34 ProtocolServer: Integrate LibGemini for simple requests 2020-05-17 12:41:38 +02:00
Andreas Kling
cd29844632 LibIPC: Allow opt-in UTF-8 validation on message parameters
You can now mark String message parameters with the [UTF8] attribute.
This will cause the generated decoder to perform UTF-8 validation and
reject the message if the given parameter is not a valid UTF-8 string.

This frees up the receiving side from having to do this validation at
a higher level.
2020-05-16 14:13:09 +02:00
Shannon Booth
df43e09433 LibGUI+WindowServer: Allow applications to set custom cursor bitmaps
This will allow e.g PaintBrush to use custom cursors for each tool.
2020-05-16 09:44:55 +02:00
Sergey Bugaev
e5a231e36f Clipboard: Remove accidentally commited file 2020-05-15 10:01:35 +02:00
Andreas Kling
97a8b6e402 Clipboard: Add missing copyright header 2020-05-15 10:00:17 +02:00
Andreas Kling
244efe050a Clipboard: Move the system clipboard to a dedicated service process :^)
This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.

To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
2020-05-14 22:53:58 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
DexesTTP
aab998e776 WindowServer: Invalidate the cursor when setting an override cursor 2020-05-13 09:33:37 +02:00
Andreas Kling
c2b5519ce2 LibGUI+WindowServer: Allow apps to use the "move" cursor :^) 2020-05-13 00:16:40 +02:00
Andreas Kling
977863ea07 LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Andreas Kling
8b8a5fc6c6 LibHTTP+ProtocolServer: Use CaseInsensitiveStringTraits for headers
These are supposed to be interpreted caselessly so let's just use the
case insensitive traits throughout. This means we'll understand things
like "Content-Length" even when they send "content-length" etc.
2020-05-12 19:10:01 +02:00
Andreas Kling
512c04c64f LaunchServer+LibDesktop: Add API to list handlers for a given URL
You can now ask for a list of applications that can handle opening
a given URL. This will be useful for creating context menus.
2020-05-12 18:49:24 +02:00
Andreas Kling
cba4880301 LaunchServer: Remove tab characters in LaunchServer.ipc 2020-05-12 18:49:24 +02:00
Andreas Kling
f2058a39bf WindowServer: Shade the bottom of the menu bar like a button
This adds a row of secondary (darker) shade to the menubar, giving it
a more buttonish look to match the highlight added to the Taskbar. :^)
2020-05-10 22:32:12 +02:00
Andreas Kling
4e766c8159 Taskbar: Let's custom paint the background instead of using GUI::Frame
Previously we were wasting the bottom pixel row on darkness. Use the
base button color all the way to the bottom row and offset the top
highlight by one pixel instead.
2020-05-10 22:32:12 +02:00
Andreas Kling
c6f098c5a9 WindowServer: Add 2px of tasteful space above maximized windows
This makes the visual interaction between the menu bar and the window
a lot less janky looking.
2020-05-10 14:46:23 +02:00
Shannon Booth
eb43e2d544 WindowServer: Add basic search functionality in menus
Perform a case insensitive search through the current menu. Jump to the
first item matching all keys in the current search. Backspace can clear
the current search, and the search will timeout after 3 seconds.
2020-05-10 13:34:51 +02:00
Shannon Booth
d5c40899cb WindowServer: Rework and simplify Menu event handling
The menu manager will now send events directly to the current menu.
Previously if a menu was opened it would always be set as the current
menu. Now when opening a menu you can optionally say that you do not
want to have it as the current menu.

One scenerio when this happens is when a menu is popped up as part of a
preview, for example, when hovering over a menu item that is a submenu.

Sending the event to the current menu simplifies things and solves a few
inconsistencies in bevhaviour (such as hovering over a submenu, but key
events not being sent to the submenu).
2020-05-10 13:34:51 +02:00
Shannon Booth
b1c83e5a64 WindowServer: Remove stray semicolon 2020-05-10 13:34:51 +02:00
Andreas Kling
7aa2acefd0 WindowServer: Cancel any ongoing input tracking when a menu pops up
When the user opens a context menu by right-clicking on something,
we now immediately stop sending mouse events to whoever was doing
active input window tracking before.

There are probably more situations where we should do this, and maybe
there's also a more generic way to express it, but this works for now.
2020-05-09 16:40:13 +02:00
Nicholas Hollett
2708cc0f72 LaunchServer: Add the LaunchServer to centralise file associations.
Step one of moving DesktopServices::open handling out of process. This
makes it easier to do things like read in associations for which program
opens which files or protocols. This gives users the ability to modify
the associations without having to rebuild :^)
2020-05-09 15:12:56 +02:00
Andreas Kling
239fd33405 Services: Move Taskbar and SystemMenu from Applications to Services 2020-05-08 22:00:41 +02:00
Andreas Kling
cf3b58fbe8 Services: Renamed from Servers
It didn't feel right to have a "DHCPClient" in a "Servers" directory.
Rename this to Services to better reflect the type of programs we'll
be putting in there.
2020-05-08 21:57:44 +02:00