Commit Graph

123 Commits

Author SHA1 Message Date
Andreas Kling
82c38f6fdf WindowServer: Decide on a window title before measuring its width
If we add "(Not responding)" to the title of an unresponsive window,
the title rect needs to be wider or we'll have text-on-stripes.

Thanks to @SharpOB for reporting this bug!
2020-07-18 01:50:24 +02:00
Nullspeak
51b2b0d5e5 WindowServer: New title bar vars for themes
The theming system can now control title bar height, title button
size, title stripe color and the title text shadow color.
The implemented theme metrics system could be later extended to LibGUI
to allow themes to change widget padding, border width, etc.
2020-07-17 23:19:08 +02:00
Tom
f591157eb8 WindowServer: Fix picking new active window after destroy
We need to mark windows as destroyed and not consider them
when picking a new active window. Fixes lost focus after
closing some windows.
2020-07-16 19:47:11 +02:00
Tom
603c17262c WindowServer: Fix traversing modal stack
When walking the modal window stack upwards, we need to check if
the top modal window is still a descendant of the window that
the parent is blocked by. Fixes not all windows being brought to
the front when trying to active a parent in the middle of the
modal window stack.
2020-07-16 19:47:11 +02:00
Tom
d87f876946 WindowServer: Fix crash when no active input window is set 2020-07-16 16:10:21 +02:00
Tom
a269e3e573 Taskbar: Don't create buttons for modal windows
Since the user can't really do much with windows that are blocked
by a modal window, there is no point in showing multiple buttons.
2020-07-16 16:10:21 +02:00
Tom
bbdf0665fc WindowServer: Expose window parent information and more modal improvements
* The parent information is necessary by the Taskbar to be able to
  determine a modal window's parent
* Minimize and maximize modal window stacks together
2020-07-16 16:10:21 +02:00
Tom
862ab82c19 WindowServer: Fixes for modal windows
This fixes a few problems with modal windows:

* If any child window, or any child window further down the
  tree is considered modal, then all windows in that chain
  are modal.
* When trying to activate a window blocked by a modal child
  bring the entire stack of modal windows to the front and
  activate the modal window.
* A window is modal if it has a parent and it's flagged as
  modal, regardless of whether the ClientConnection has
  created modal windows.

This technically supports diverging modal window trees as well,
where two modal windows share the same parent, allowing both to
be activated (including for input) but not the parent. And it
should also support modal window stacks of arbitrary depth.
2020-07-16 00:08:01 +02:00
Tom
d7c87e84f3 WindowServer: Don't make window active by hovering over the icon 2020-07-15 22:03:28 +02:00
Tom
8286e72187 WindowServer: Make Menus the input window when showing them
This solves a problem where windows don't receive a WindowInputLeft
event when popup menus are opened. This prevented ComboBox being
closed when right clicking the application on the task bar.
2020-07-15 22:02:53 +02:00
Tom
ec3737510d WindowServer: Add accessory windows
Accessory windows are windows that, when activated, will activate
their parent and bring all other accessory windows of that parent
to the front of the window stack. Accessory windows can only be
active input windows. The accessory window's parent is always the
active window regardless of whether it is also the active input
window.

In order to route input correctly, input is now sent to the active
input window, which can be any accessory window or their parent,
or any regular window.
2020-07-15 17:15:45 +02:00
Tom
7739497e34 FileManager: Allow double-clicking applications again
By adding a special LauncherType::Application we can still
get meta data for the application, but also know that we should
consider executing that binary as the default action. LaunchServer
will not do this for us, as it should probably not be allowed to
run arbitrary binaries that haven't been registered as handlers.
2020-07-15 00:11:30 +02:00
Tom
535113bac4 Launcher: Provide launcher details to LibDesktop
This allows applications to get additional information,
such as name or icons, for each launch handler.
2020-07-15 00:11:30 +02:00
Tom
1c1ab71692 WindowServer/LibGUI: Add default menu items and allow default action for context menu
By specifying an optional Action for Menu::popup an application
can specify what item should be displayed as a default item.
2020-07-11 11:45:49 +02:00
Tom
fc4e01a3c9 WindowServer: Add support for default MenuItem
This allows marking a MenuItem as a default action, e.g. in a
context menu for an action that reflects what e.g. a double click
would perform.

Also enhance the window menu to mark the close action as the
default, and when double clicked perform that action.

Fixes #1289
2020-07-11 11:45:49 +02:00
AnotherTest
684b04e02a WebServer: Allow the user to specify the base directory
This commit makes the WebServer accept a base path to serve.
This makes taking files out of the system significantly more simple
(depending on whom you ask).
2020-07-11 11:36:12 +02:00
Linus Groh
ec5845212d WindowServer: Apply the "wait" cursor to unresponsive windows 2020-07-07 23:11:39 +02:00
Linus Groh
899dcba158 WindowServer+LibGUI: Add "wait" cursor 2020-07-07 23:11:39 +02:00
Linus Groh
b8a8e417f1 WindowServer+LibGUI: Add "help" cursor 2020-07-07 23:11:39 +02:00
Linus Groh
62866208ee WindowServer+LibGUI: Add "resize row/column" cursors 2020-07-07 23:11:39 +02:00
Andreas Kling
787673b743 WindowServer: Turn an assertion that happens sometimes into a dbg()
It's very annoying to crash the WindowServer when something harmless
is a little weird.
2020-07-07 17:10:12 +02:00
Andreas Kling
7527b9ee72 WindowServer: set_active_window() should not assume window has a client
I saw this assertion fire once and I don't know how I made it happen,
but it seems fine for client-less windows to become active, they just
don't have a menubar to install.
2020-07-07 17:10:12 +02:00
Andreas Kling
92374fc942 LibWeb: Make context menus work in WebContentView
As usual, this was just a matter of plumbing the PageClient calls from
the WebContent side over to the WebContentView side. :^)
2020-07-07 12:24:29 +02:00
Andreas Kling
9169c8ca94 LibWeb: Make the WebContentView::on_load_start hook actually work :^) 2020-07-06 21:58:16 +02:00
Andreas Kling
32243e1df2 WebContent: Plumb link clicks to the WebContentView :^)
You can now react to links being clicked via the on_link_click hook.
2020-07-06 20:02:30 +02:00
Andreas Kling
6f059ee830 ProtocolServer: Turn this into a multi-instance service
Everyone who connects to ProtocolServer now gets his own instance.
This means that different users can no longer talk to the same exact
ProtocolServer process, enhanching security and stability.
2020-07-06 13:30:11 +02:00
Andreas Kling
a122a544da WebContent: Shut down WebContent process when last client disconnects
Note that there is only ever one client.
2020-07-06 13:30:11 +02:00
Andreas Kling
94ddb07e58 LibIPC+Services: Make ClientConnection take socket as NonnullRefPtr
This avoids getting into the awkward situation where the socket is
still part-owned by main() in multi-instance service. Also it just
reads nicer.
2020-07-06 13:30:11 +02:00
Andreas Kling
58b1ba2545 WebContent: Plumb hovered links from WebContent process over to widget
Also add a little GUI::StatusBar to the demo app so we can see the
hovered link URL's live. :^)
2020-07-05 16:59:20 +02:00
Andreas Kling
aac362b883 WebContent: Put some debug spam behind an #ifdef
This makes resizing the window a little less obnoxious. :^)
2020-07-05 16:49:40 +02:00
Andreas Kling
668fe61b1d WebContent: Coalesce pending paint events to reduce overdraw
Instead of painting synchronously whenever a Paint request comes in,
the WebContent process will now buffer pending paints and coalesce
them and defer the actual paint using a zero-timer.

This significantly reduces flickering already, without doing any
double-buffering in the WebContentView widget.
2020-07-05 16:26:15 +02:00
Andreas Kling
131bc8fd31 WebContent: Plumb scroll-into-view requests from server to client
The WebContentView widget will now be able to react to scroll-into-view
requests from the WebContent process.
2020-07-05 15:57:07 +02:00
Andreas Kling
c15f9e7593 WebContent: Plumb title changes over to the WebContentView
WebContentView now fires its on_title_change hook, like Web::PageView.
We use this in the WebView test app to update the window title. :^)
2020-07-04 23:40:17 +02:00
Andreas Kling
7cb7bcb924 WebContent: Illustrate multi- vs single-process diffs in documentation 2020-07-04 23:34:12 +02:00
Andreas Kling
e91871aed7 WebContent: Basic scrolling support! :^)
The WebContentView widget now inherits from GUI::ScrollableWidget and
will pass its scroll offset over to the WebContent process as it's
changing. This is not super efficient and can get a bit laggy, but it
will do fine as an initial scrolling implementation.

Just like the single-process Web::PageView widget, WebContentView also
paints scrolled content by translating the Gfx::Painter.
2020-07-04 23:19:32 +02:00
Andreas Kling
ada3c9ca46 WebContent: Put some debug spam behind an #ifdef 2020-07-04 23:19:12 +02:00
Andreas Kling
3005c0af69 WebContent: Add a little text file I drew of the server/client classes 2020-07-04 23:17:58 +02:00
Andreas Kling
a4b5350aff WebContent: Notify client when web content selection changes
The WebContentView widgets reacts to this by requesting a repaint.
2020-07-04 20:57:57 +02:00
Andreas Kling
8bd2fd8df9 Taskbar: Don't wrap minimized window titles in []
This actually looks a lot nicer without the [] and I'm not sure that
the visual cue about minimization state was actually useful.
2020-07-04 20:03:09 +02:00
Andreas Kling
b85a57ead7 WindowServer: Move window titles 1px to the right
This makes it look nicer with wide window icons.
2020-07-04 19:21:57 +02:00
Andreas Kling
d851863704 Userspace: Remove a bunch of unnecessary Kernel/API/KeyCode.h includes 2020-07-04 17:25:31 +02:00
Andreas Kling
11c4a28660 Kernel: Move headers intended for userspace use into Kernel/API/ 2020-07-04 17:22:23 +02:00
Andreas Kling
1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
Maciej Zygmanowski
fc79fefb5e WindowServer: Don't crash when invalid resolution requested 2020-07-03 12:31:40 +02:00
Peter Elliott
f833362536 WindowServer: don't send resize on resolution change unless needed
fixes #2575

The extra ResizeEvent would be handled after on_rect_change, and would
reset the size of main_widget to what it was before the resize.

Bonus: Less unnecessary events.
2020-06-29 16:50:40 +02:00
Nico Weber
12cbc4ad0d Everywhere: Replace some uses of fork/exec with posix_spawn
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
2020-06-29 12:04:27 +02:00
sppmacd
abdf36b171 SystemMenu: Fix shutdown dialog
It was shutting down even if selected Restart.
2020-06-28 14:32:17 +02:00
Andreas Kling
e50fa413cb WindowServer: Move window title bar icons 1px to the right
This makes wider icons look better, since they no longer rub up against
the left edge.
2020-06-28 00:09:01 +02:00
Ruairidh MacLeod
6400122760
SystemServer: Fix typo (exist -> exit) (#2615)
Small typo that I noticed on the latest OS hacking video!
2020-06-23 14:52:15 +02:00
Andreas Kling
c74b5fd798 WebContent: Unveil access to the ImageDecoder service :^) 2020-06-23 14:28:45 +02:00