Commit graph

483 commits

Author SHA1 Message Date
Sam Atkins
e5e3099ce7 UI: Route node picker input through WebView
Picker input starts in each platform UI, while protocol state lives in
LibWebView. Route movement, primary clicks, Escape, and leave events
through the WebView picker API so each frontend drives the same hit-test
and picker-event path.

The selected click is consumed because picker mode uses it to choose an
element for DevTools rather than activate page content.

AppKit routes normal mouse input through WebViewBridge, which converts
view points to device pixels before forwarding to LibWeb. Picker input
bypasses that enqueue path, so apply the same scaling before requesting
a picker hit test.
2026-05-29 17:01:34 +01:00
Andreas Kling
32288c1c89 UI/Qt: Paint web view fallback at device size
WebContentView scales its painter into device-pixel coordinates before
painting page bitmaps. When no page bitmap was available, the fallback
fill still used the widget rect in CSS pixels. On high-DPI displays, it
only filled the top-left portion of the viewport.

Use the stored device-pixel viewport size for the no-bitmap fill and for
the fallback area around a smaller bitmap.
2026-05-29 16:48:14 +02:00
Timothy Flynn
11d80c122e LibWebView+UI: Add an option to toggle a menu's visibility
This requires setting up an observer interface akin to menu actions.
2026-05-29 10:46:27 -04:00
Timothy Flynn
a1b545e179 UI/AppKit: Add a function to create NSMenuItem menus
This abstraction is needed for an upcoming commit to make the UI layer
react to changes in menu visibility. It turned out to be a nice cleanup
in any case.
2026-05-29 10:46:27 -04:00
Timothy Flynn
42c9fcf88f UI/Qt: Paint the dragged tab preview with some transparency
Makes it a bit easier to see where the tab is being dragged to.
2026-05-29 10:04:25 -04:00
Timothy Flynn
af410da20c UI/Qt: Paint the drag preview for all tabs
We attempted to paint a preview of the dragged tab, but this only worked
for the first tab. For other tabs, we were passing a negative offset to
QWidget::render, causing the preview to render transparently.
2026-05-29 10:04:25 -04:00
Timothy Flynn
763d194002 UI/Qt: Restore ability to close tabs with the middle mouse button
We were trying to handle this in TabWidget::event, but this mouse event
is now delivered to the child TabBar, where the event is accepted and
thus not propagated further.
2026-05-29 10:04:25 -04:00
Andreas Kling
3746fbf7f4 LibWeb: Use themed text selection colors
Use the page palette for default selection backgrounds instead of a
hardcoded blue color. Tint opaque selection backgrounds before painting.
Selected images stay visible through the overlay.

Use SelectionText for default selected text and HighlightText. Authored
::selection colors still take precedence. On macOS, use a light
translucent color matching other engines.

Update selection and system-color baselines for the themed colors. Add
macOS-specific screenshot baselines for tests whose expectations depend
on system colors.
2026-05-29 13:49:51 +02:00
Aliaksandr Kalenik
6598fb838d LibWebView+Compositor+UI: Send display metadata to Compositor
The browser process forwards the maximum frame rate to WebContent, but
the compositor process had no copy of that display timing metadata or
the display identity needed by compositor-local vsync.

Add one compositor control IPC message carrying the optional display ID
and refresh rate together, and store both values on each compositor
context.
2026-05-28 23:12:35 +01:00
Aliaksandr Kalenik
69f3e9e623 UI/Qt: Track screen changes after native window creation
BrowserWindow only connected QWindow::screenChanged while setting up
the non-Wayland DPI path. On Qt Wayland this path is skipped
because device-pixel-ratio changes are delivered to the window instead
of QScreen. A window could stay associated with the screen reported
during construction until the native QWindow exists, so refresh-rate
updates were missed when the window moved between outputs.

Separate refresh-rate and screen tracking from the DPI-specific signal
handling. Connect QScreen::refreshRateChanged for the current screen on
all platforms, connect QWindow::screenChanged when the native window
becomes available, and use ScreenChangeInternal as an additional update
hook. The DPI signal remains disabled for Qt Wayland, where
DevicePixelRatioChange is still handled through BrowserWindow::event().
2026-05-28 23:12:35 +01:00
Timothy Flynn
fdacf590ef UI/Qt: Retain hovered appearance over bookmark items when right-clicked
It feels a bit off to right-click a bookmark item and have it lose its
hovered appearance. Other browsers also retain this appearance.
2026-05-28 22:04:24 +02:00
Timothy Flynn
af82d31cdc UI/Qt: Polish bookmarks bar layout
Custom-paint bookmark bar buttons so favicons and titles are spaced and
vertically centered consistently. Qt’s default QToolButton label layout
does not expose enough control over the icon/text gap or pixel-level
vertical alignment needed for the tightened bookmarks bar.
2026-05-28 22:04:24 +02:00
Timothy Flynn
32c11518d7 UI/Qt: Restore application menu icons for bookmark items
Commit 972c19b292 removed most icons from
application menus. But all other browsers show favicons in the bookmark
menu. So let's restore those icons.
2026-05-28 22:04:24 +02:00
Timothy Flynn
a4cada05c2 UI/Qt: Allow shrinking the browser window smaller than the bookmarks bar
This regressed in commit 8f14e85af4.
2026-05-28 22:04:24 +02:00
Sam Atkins
d3ad37e635 Meta: Define helper processes for Ladybird and test-web in one place
These both require the same helper processes, and maintaining the same
list in multiple places is error-prone. For example, I spent too long
debugging why test-web was crashing, when the issue was that Compositor
hadn't been rebuilt as test-web didn't depend on it. That problem can
no longer happen if we define the same dependency list for both.
2026-05-28 14:45:48 +01:00
Timothy Flynn
2773e45db5 UI/Qt: Consistently place the tab close button across platforms
Before the recent Qt overhaul, we had no control over the position of
the tab close button (without drawing/maintaining it ourselves, which we
now do). Qt automatically placed the tab close button on the left side
of the tab bar on macOS, and as such, we had to go out of our way to
place the audio state button on the right side. See:
dd54780d5e

We now consistently place the audio state button on the left and the tab
close button on the right. Qt still attempts to draw its own tab close
button on the left, so we also explicitly set that to null initially.
2026-05-28 10:33:05 +02:00
Timothy Flynn
1677cea482 UI/Qt: Slightly enlarge a few toolbar icons
Render the new tab, close tab, and hamburger icons a bit larger. And
slightly separate the 3 horizontal hamburger lines.
2026-05-28 00:53:35 +02:00
Timothy Flynn
53da1ba937 UI/Qt: Render icons better on high DPI devices
Generate DPR-tagged pixmap variants for generated icons (this includes
chrome icons, TVG icons, and bookmark favicons). Previously, these icons
would render very blurry on macOS.
2026-05-28 00:53:35 +02:00
Andreas Kling
576d46e6fa UI/Qt: Balance tab strip window control padding
Use matching top and right padding around the tab strip window controls
when the menu bar is hidden, while keeping the existing left spacing for
tabs and the resize edge.
2026-05-27 22:05:54 +02:00
Andreas Kling
770829a855 UI/Qt: Put window controls in visible menu bar
Add a menu bar corner widget for the frameless window controls when
the Qt menu bar is visible. Hide the tab strip controls in that mode
so the buttons stay at the top-right edge of the window, and remove
the separator below the menu bar so the chrome reads as one surface.

Use compact menu bar controls and keep the right padding tight so the
buttons align with the edge without changing the hidden-menu layout.
2026-05-27 22:05:54 +02:00
Andreas Kling
d788b67863 UI/Qt: Treat empty menu bar space like a title bar
Start a platform window move when pressing empty space in the Qt menu
bar. Toggle maximized state on double-click, matching the tab strip.

Menu actions keep their normal behavior, and resize edges still take
precedence before starting a move.
2026-05-27 22:05:54 +02:00
Andreas Kling
1c8223bffa UI/Qt: Add a shared window control button
Add a shared WindowControlButton for the frameless window controls. It
clears the pressed visual state when the pointer leaves during a press,
and restores it on re-entry.

Also reset transient button state around double-clicks so pressed
styling cannot get stuck after the window state changes.
2026-05-27 22:05:54 +02:00
Andreas Kling
ff26662256 UI: Remove unused menu icon resources
Drop the PNG resources that were only used for menu action icons.
Keep the app icons and directory listing icons that still have direct
resource references, and stop copying the now-empty browser icon set.
2026-05-27 22:05:54 +02:00
Andreas Kling
972c19b292 UI/Qt: Remove icons from menus
Let application actions opt out of icon creation when created for
menus. Use that path for browser menus, tab context menus, and
WebView-backed popup menus.

Keep icon creation for toolbar and bookmarks bar actions, where the
same helper still provides visible button icons. Remove the icon setup
that is now only used by menu actions, and shrink popup menu item
padding now that there is no icon column.
2026-05-27 22:05:54 +02:00
Andreas Kling
0baeddd972 UI/Qt: Style popup menus
Add application-level QMenu styling using the existing chrome palette so
menu bar dropdowns, hamburger menus, context menus, and other popups use
the same colors and item states. Refresh the application stylesheet when
the Qt palette or theme changes.
2026-05-27 22:05:54 +02:00
Andreas Kling
7e034608ef UI/Qt: Style the menu bar
Add a QMenuBar stylesheet that uses the same chrome palette as the tab
strip and navigation toolbar. Apply it from BrowserWindow and refresh it
when the palette changes so the optional menu bar matches the frameless
window chrome.
2026-05-27 22:05:54 +02:00
Andreas Kling
43b9cfe5a9 LibWebView: Avoid white initial web view fills in dark mode
Seed the page background fallback from the platform color scheme before
WebContent has painted. Update the same fallback when the platform theme
changes, and when the preferred color scheme is forced through the debug
menu, so unpainted web view areas use the matching Canvas color.
2026-05-27 20:57:38 +02:00
Timothy Flynn
793e7dd01b LibWeb+LibWebView+UI: Update the selection keyboard on selection changes
When the selected text on a page changes, update the system selection
clipboard on supported systems (if primary pasting is enabled).
2026-05-27 13:33:44 -04:00
Timothy Flynn
082281da62 LibWebView+UI: Disable primary paste on unsupported systems
A selection clipboard is not available on all systems. The UI now
controls whether this feature is available.
2026-05-27 13:33:44 -04:00
Timothy Flynn
adf5e0a226 LibWeb+LibWebView+UI: Use the system selection text for primary pasting
Commit 218d82cb65 added support for
pasting text with the middle mouse button. But primary pasting is
actually meant to interact with the "selection" clipboard, not the
text clipboard.
2026-05-27 13:33:44 -04:00
Timothy Flynn
aaeaf11d45 UI/Qt: Shrink the bookmarks bar padding a bit
It takes up quite a bit of room that exceeds that of other browsers.
2026-05-27 13:13:11 -04:00
Timothy Flynn
8f14e85af4 UI/Qt: Store the toolbar and bookmarks bar in a common container
The bookmarks bar sticks out a bit too much in its own container with
its own background color. This adds a common container for both bars
so that we can apply the background color gradient to that common
container. This naturally handles showing/hiding the bookmarks bar
gracefully.
2026-05-27 13:13:11 -04:00
Timothy Flynn
3504b95589 UI/Qt: Remove stored layout object from the Tab
This is never referenced outside the constructor; we don't need to store
a pointer to it. (I had accidentally removed it in a subsequent commit,
then realized we didn't need it anyways).
2026-05-27 13:13:11 -04:00
Andreas Kling
e0e8460c47 UI: Update page visibility when switching tabs
Send hidden and visible system visibility updates from explicit tab
switch paths instead of relying only on widget show and hide events. Tab
containers can keep inactive web views mapped, which leaves documents
visible from WebContent's perspective and lets animated images keep
running in background tabs.

Use AppKit window occlusion state rather than the app-wide active tab.
That keeps still-visible background windows in the visible document
state. Avoid resending duplicate visibility updates from
ViewImplementation so existing widget visibility notifications remain
harmless.
2026-05-27 18:44:42 +02:00
Aliaksandr Kalenik
9ab311507e LibWeb+UI: Synthesize ctrl-wheel events for pinches
Trackpad pinches applied directly as visual viewport zoom, so pages
could not observe the gesture or cancel the browser default. Canvas
apps such as maps expect the ctrl-wheel path instead.
2026-05-27 12:53:08 +02:00
Aliaksandr Kalenik
baecb14472 UI/AppKit: Normalize pinch magnification updates
NSMagnificationGestureRecognizer exposes magnification as an accumulated
value for the current gesture. Ladybird kept its own previous value in
WebViewBridge and emitted the residual delta when the gesture ended, so
the Web input pipeline did not receive the same per-update shape as the
native changed events.

Reset the recognizer's magnification accumulator after changed updates
and skip begin/end states. This keeps the AppKit side responsible for
delivering concrete scale changes and removes the bridge pinch state.
2026-05-27 12:53:08 +02:00
Andreas Kling
d6b6efa27a UI/Qt: Reserve browser chrome shortcuts
Let browser chrome shortcuts for tab and window management bypass the
WebContent shortcut override path. This makes new tab, new window,
reopen closed tab, tab switching, close tab, and quit dispatch through
Qt immediately instead of waiting for page event handling.
2026-05-26 23:12:50 +02:00
Timothy Flynn
3b14addb14 UI/Qt: Use QString format helper in various components 2026-05-26 15:17:56 -04:00
Timothy Flynn
6e2c92bb8b UI/Qt: Use QString format helper to create UI stylesheets 2026-05-26 15:17:56 -04:00
Timothy Flynn
87e84dabe4 UI/Qt: Add a utility to create a QString using our own format infra
QString::arg has an internal limit of 8 arguments. Let's add the ability
to use our own formatting logic going forward.
2026-05-26 15:17:56 -04:00
Andreas Kling
42f89bb679 LibWebView: Fast-close pages without beforeunload prompts
Track whether WebContent still needs a beforeunload check and let the
frontends immediately remove a tab or window when no prompt can be
shown. WebContent still receives the close request so pagehide, unload,
and cleanup steps can run.

When the visible view is removed immediately, keep detached ownership of
the WebContent page until it reports that the top-level traversable
closed. If no acknowledgement arrives, release detached ownership and
ask ProcessManager to shut down the unused WebContent process.
2026-05-26 20:40:25 +02:00
Andy Heitke
297a727970 UI/Qt: Disable QWinEventNotifier before closing process_handle
When a child process terminates on Windows, the QWinEventNotifier
emits the activated signal it its event handler. Before this
happens, we need to call setEnabled(false) to unregister the
wait object from the Windows thread pool. setEnabled(false)
also causes us to wait for any outstanding callbacks to complete
and then prevents QWinEventNotifier from trying to use the closed
handle.

This seems to follow the pattern from Qt where the destructor also
calls setEnabled(false) before destruction.
2026-05-26 20:32:54 +02:00
Timothy Flynn
8ccdea63f5 UI/Qt: Apply a stylesheet to the devtools status bar 2026-05-26 13:06:54 -04:00
Andreas Kling
5805a374d4 UI/Qt: Preserve hidden omnibox edits on new tabs
Keep late about:newtab load notifications from clearing hidden location
text after the user has started typing. Let LocationEdit own cursor
placement for normal URL display so load-start updates do not disturb
inline autocomplete selection.
2026-05-26 17:37:40 +02:00
Andreas Kling
fa1896c2c9 UI/Qt: Refine chrome icon rendering
Draw back and forward icons as filled stroked paths so the arrow tips do
not accumulate alpha where segments meet. Increase their apparent size,
shift the menu glyph down slightly, and raise the new tab icon to align
with the tab strip.
2026-05-26 15:20:59 +02:00
Andreas Kling
14ac01b0ce UI/Qt: Refine chrome layout spacing
Keep active and hovered tabs on the same geometry while tightening the
surrounding chrome rhythm. Reduce tab and toolbar padding, shorten the
navigation toolbar and omnibox, center the new tab button, and enlarge
tab close buttons to match the refined tab sizing.
2026-05-26 15:20:59 +02:00
Andreas Kling
b8e266c631 UI/Qt: Centralize chrome material colors
Define neutral chrome material anchors in one place and derive shared
surface, hover, pressed, and border colors from them. This removes
system accent color from chrome hover fills and gives the tab strip,
toolbar, and omnibox separate material roles in both color schemes.
2026-05-26 15:20:59 +02:00
Tim Ledbetter
c334760815 UI/Qt: Paint styled background for find in page widget
The `WA_OpaquePaintEvent` attribute on `BrowserWindow` means Qt no
longer fills widget backgrounds automatically. Plain `QWidget`
subclasses do not paint their stylesheet backgrounds by default, so the
find in page bar lost its background color and did not clear its state
correctly between repeats . Setting `WA_StyledBackground` tells Qt to
honor the stylesheet background property in the widget's paint cycle.
2026-05-26 09:08:51 +02:00
Tim Ledbetter
a692c7143d UI/Qt: Size the hovered link label using a size hint
This prevents the right edge of the hovered link label being cut off.
2026-05-26 09:08:16 +02:00
Tim Ledbetter
13146078a3 UI/Qt: Style the hovered link label with chrome surface colors
The label was missing background and text color properties, making
it difficult to read against page content.
2026-05-26 09:08:16 +02:00
Tim Ledbetter
91cd6e85c9 UI/Qt: Use parent maximization state when detaching to a new window 2026-05-26 09:07:57 +02:00
Tim Ledbetter
ee3960e425 UI/Qt: Detach dragged tabs dropped outside any tab bar to a new window
Previously, a tab would only detach into a new window when dropped
outside the source window entirely. Dropping a tab onto the content
area of any browser window would instead silently move it to the end of
that window's tab bar.

TabWidget now rejects tab drag events outside its tab bar row, and the
detach condition checks the tab bar row bounds rather than the full
window geometry. This means dropping a tab anywhere that is not a tab
bar row opens a new window at the cursor position.
2026-05-26 09:07:57 +02:00
Andreas Kling
5e42dd0e26 UI/Qt: Keep chrome style refreshes coalesced
Keep the pending chrome style refresh marker set while the deferred
refresh runs. Applying the refreshed stylesheet can synchronously
deliver palette/style change events, and clearing the marker first lets
those self-induced events enqueue another immediate refresh.

This prevents the Qt chrome from spinning through repeated stylesheet
updates and repainting the location field shadow at idle.
2026-05-26 02:03:43 +02:00
Andreas Kling
7a4a633d04 UI/Qt+WebContent: Refresh theme colors live
Refresh Qt chrome palettes from the current color scheme when the
application palette changes. Recompute autocomplete and location field
colors and repaint WebContent immediately so theme changes do not
require another interaction or restart.
2026-05-26 01:18:51 +02:00
Andreas Kling
3adeed9581 UI/Qt: Polish browser chrome appearance
Refine the material colors, tab integration, toolbar spacing, and
custom glyphs used by the Qt browser chrome. Keep the visual density
compact while making the controls feel clearer and less toolkit-like.
Mark the window opaque and show resize cursors for frameless chrome.
2026-05-26 01:18:51 +02:00
Andreas Kling
6aeec196f0 UI/Qt: Support dragging tabs between windows
Allow custom Qt tabs to be reordered, detached, and reparented to
other browser windows while preserving the existing tab state. Draw a
full-tab drag preview and keep tab drags from being interpreted as
frameless window moves.
2026-05-26 01:18:51 +02:00
Andreas Kling
328d89f3c1 UI/Qt: Draw custom browser window chrome
Add shared chrome styling helpers and use them to paint the Linux
browser tab strip and surrounding toolbar widgets. Make the browser
window frameless on Qt so the tabs, toolbar, and window controls can
share one integrated chrome surface.
2026-05-26 01:18:51 +02:00
Andreas Kling
8be96396d9 LibWebView: Use page background color while resizing
Notify the UI process with the solid canvas background color recorded
for the top-level document. This is the Canvas system color with the
effective document background composited over it, matching the color
used before normal painting.

Store that color on the view and use it when AppKit, Qt, and Gtk need
to fill areas exposed while an older bitmap is still on screen during a
window resize.
2026-05-24 23:41:41 +02:00
Andreas Kling
82b270a154 UI: Add WebContent PID debug preference
Register debug.process.show_web_content_process_id and use it to append
the active WebContent process ID to tab titles and tab tooltips in the
Qt, Gtk, and AppKit frontends.

Keep the stored page title unchanged so toggling the preference can
refresh each tab without waiting for a new title update.
2026-05-24 13:11:17 +02:00
Andreas Kling
5b324718ec LibWebView: Add JSON-backed config variables
Add a small registry for config variables backed by JsonValue defaults.
Persist values under configVariables and expose the registry through the
Advanced tab in about:settings so every key remains visible and
filterable.

Use the default JsonValue type for validation instead of maintaining a
parallel type enum.
2026-05-24 13:11:17 +02:00
Andreas Kling
96bad93bb2 LibWeb: Use adblock-rust in ContentBlocker
Replace the local substring matcher with the adblock-rust engine exposed
through the dedicated content blocker Rust FFI. Keep the previous engine
when a replacement list cannot be parsed.

Pass shared list buffers directly into Rust instead of building a
duplicate C++ vector of lines first. Generate cosmetic CSS through the
Rust matcher, including generic class and id selectors collected from
shadow-including descendants.

Keep a supplemental index for generic cosmetic selector-list rules.
adblock-rust indexes these rules under the first class or id token only,
so also key them by later simple class and id selectors in the list.

Update ContentBlocker coverage for rule options, exceptions, third-party
checks, blob and file URLs, invalid list replacement, filtering toggles,
cosmetic CSS, and generic selector-list cosmetics.
2026-05-24 08:16:46 +02:00
Aliaksandr Kalenik
bfc9bf80d9 Compositor+LibWebView+WebContent: Scaffold opt-in Compositor process
The compositor is moving into a dedicated helper process. That requires
a process to launch, channels for Browser and WebContent to talk to it
over, and client proxies on each side. Land all of that as an inert
scaffold first, gated behind --enable-compositor-process, so the default
rendering path is unchanged and later commits can fill in the protocol,
the service-side state, and the runtime switch against a stable target.
2026-05-22 19:50:42 +01:00
Andreas Kling
46e1a08742 LibWeb: Rename ContentFilter to ContentBlocker
Rename the local content blocking implementation and its tests from
ContentFilter to ContentBlocker while keeping the existing substring
matcher backend and behavior.

Update the WebContent IPC method, WebView option names, debug toggle,
and default config file name to use content blocker terminology.
2026-05-21 21:16:56 +02:00
Timothy Flynn
f0d7e28f55 LibWeb+LibWebView+UI: Move SelectedFile factory to LibWebView
This factory is only used by the UI. An upcoming commit will make it
depend on LibFileSystem. LibWeb currently does not link LibFileSystem,
and doing so would push LibWeb in the wrong direction (we should be
doing less file IO in LibWeb, not more).
2026-05-20 21:09:22 +02:00
Andreas Kling
31a9878223 UI/AppKit: Add New Window menu action
Open the configured new tab page in a separate AppKit window from
the File menu, matching the existing Qt action.
2026-05-20 19:31:07 +02:00
Andreas Kling
ad1b4ad76e UI: Focus web views after location bar navigation
Move keyboard focus to the web view when the user commits the
location field. Relying on URL-change callbacks is unreliable because
ViewImplementation::load() stores the requested URL before WebContent
reports it, so same-URL reports are suppressed before frontends can
perform their focus handoff.

Keep the new-tab page behavior unchanged: creating a blank tab still
focuses the location field until the user starts a navigation.
2026-05-20 15:04:58 +02:00
Andreas Kling
b6b13e3bbd UI/Qt: Left-align browser tab titles
Use a small proxy style for the tab label control so QTabBar still
owns tab layout, scrolling, buttons, dragging, and native tab shapes.
Only the text draw flags change to use left alignment.
2026-05-20 09:37:44 +02:00
Andreas Kling
9f8d4fdb3b UI: Mirror loading state in tab icons
Show visible tab icons as loading while the focused location field
keeps its existing page-level loading state. Cache the favicon under the
spinner so each tab restores its page icon when loading finishes.

Reuse the Qt spinner drawing for the location field and tab strip, and
draw the AppKit spinner into the attributed tab title.
2026-05-20 09:37:33 +02:00
Andreas Kling
0a70dadfb1 UI: Show page loading state in the location field
Use the leading icon in the location field as a contextual page
indicator. While a page is loading, the field shows an indeterminate
activity indicator. Once loading finishes, it shows the page favicon
when available and falls back to the generic page icon where the toolkit
has one.

Keep the GTK implementation aligned with the other frontends by using
that slot only for loading and favicon state, without a separate
security icon.

This keeps single-tab windows from losing all visual feedback when the
tab bar is hidden, without adding a fake progress bar.
2026-05-20 09:37:33 +02:00
Andreas Kling
8a1f855ce8 UI/Qt: Remove collect garbage shortcut
Leave the debug menu action available without binding Ctrl+Shift+G,
which conflicts with the standard find previous shortcut.
2026-05-19 11:22:58 +02:00
Sam Atkins
f489a8e1d0 UI/Qt: Copy window size and maximized state for new windows
Create new windows with the size of the previously active window, and
maximized if it was maximized. This matches the behaviour of other
browsers, and solves an annoying issue where new windows would always
be tiny.

Application::new_window() now takes a WindowConfiguration struct that
lets you specify the position, size, and maximized-ness of the window.
All previous callers of new_window() now use this instead of modifying
the window state afterwards.

WindowConfiguration is slightly awkwardly broken up into individual x/y
and width/height fields instead of a position and a size, for the sake
of compatibility with HTML::WebViewHints.
2026-05-13 11:04:20 +01:00
Sam Atkins
f0cb7d9a6f UI/Qt: Add functionality for reopening recently-closed tabs
Record when we close a tab, and map Ctrl+Shift+T to an action that opens
the most recently closed one.
2026-05-13 11:03:41 +01:00
jeetsh4h
44476de9c5 UI+LibWebView: Implement "Open Link in New Window" 2026-05-13 05:00:50 -05:00
Andreas Kling
9f35827aa0 LibWeb: Use double precision for wheel scroll deltas
Wheel deltas were truncated to int at the platform input boundary,
which dropped the sub-pixel tail of trackpad momentum scrolls. Each
NSEvent's scrollingDeltaY arrived as a CGFloat, got cast to int, and
flowed through IPC, EventHandler, and PaintableBox::scroll_by as int,
losing fractional information that never came back.

Widen Web::MouseEvent::wheel_delta_{x,y} to double and propagate
through Page, EventHandler, Paintable, PaintableBox, and the AppKit,
Qt, and GTK input paths.
2026-05-13 11:00:59 +02:00
Andreas Kling
49f694ea01 UI: Increase mouse wheel scroll step from 24 to 40 pixels
Other engines converge on roughly 40 pixels per line as the per-line
step for discrete mouse wheel input (Chrome's kWheelDelta of 120 over
3 lines, WebKit's Scrollbar::pixelsPerLineStep of 40, Chrome's macOS
kScrollbarPixelsPerCocoaTick of 40). At a step of 24 we were scrolling
about 60% as far per tick as Chrome on the same input, which made the
browser feel sluggish under a regular wheel.

Bumping the constant to 40 in the Qt, Gtk, and AppKit frontends puts
us at 120 pixels per discrete tick on Linux (3 lines * 40 pixels) and
aligns the macOS imprecise-scroll multiplier with WebKit and Chrome.
High-precision (trackpad) input is unaffected on all platforms, since
those paths use pixel deltas directly without applying a multiplier.
2026-05-12 23:30:19 +02:00
Christian Frey
b50b7a41d7 UI/AppKit: Fix autocomplete row clipping using visible scroll view width
Autocomplete rows were sized using the table view bounds instead of the
visible scroll view width, which caused the rounded selection highlight
to be clipped on the right edge.
2026-05-11 10:23:20 -04:00
Shehab Ahmed
f6a009e757 UI/Qt: Add a tooltip for the close tab button 2026-05-10 10:45:11 -04:00
R-Goc
02bb892d7a LibThreading/LibSync: Split out sync primitives
This commit splits out synchronization primitives from LibThreading into
LibSync. This is because LibThreading depends on LibCore, while LibCore
needs the synchronization primitives from LibThreading. This worked
while they were header only, but when I tried to add an implementation
file it ran into the circular dependency. To abstract away the pthread
implementation using cpp files is necessary so the synchronization
primitives were moved to a separate library.
2026-05-08 18:58:35 -05:00
Aliaksandr Kalenik
f8640d813a LibGfx+LibWeb: Make DecodedImageFrame a value type
DecodedImageFrame only wraps a ref-counted Bitmap and color-space
metadata. The frame object itself does not provide shared mutable
state or lifetime ownership beyond those members, so ref-counting it
adds an unnecessary layer of indirection.
2026-05-07 16:08:13 +02:00
Timothy Flynn
b221d7fe8b LibWeb+LibWebView+WebContent+UI: Add an action to cut text 2026-05-07 09:13:06 -04:00
Vanand Gasparyan
4668e7ed11 UI/Qt: Make the zoom buttton width flexible to fit the text 2026-05-06 08:25:23 +02:00
Undefine
b9fec5edbf Meta: Rename and merge some lagom_* and ladybird_*
We had both {lagom,ladybird}_test and {lagom,ladybird}_lib, now both
are just one helper. Also rename all other lagom_* helpers to be
ladybird_*.
2026-05-05 22:08:24 +02:00
Undefine
1d83e8c896 Meta: Move all remaining dependency checks to check_for_dependencies
This also allows us to get rid of a couple of files that were meant
for dependency specific checks.
2026-05-05 22:08:24 +02:00
Aliaksandr Kalenik
40f2abb7fe LibGfx+LibWeb: Add DecodedImageFrame
Decoded image data should not continue to traffic in ImmutableBitmap now
that the bitmap wrapper is being retired. Introduce DecodedImageFrame as
the paintable decoded-image unit and store a Bitmap plus ColorSpace in
it directly.

Thread the new frame type through decoded image data, display-list
image commands, filters, canvas drawImage, patterns, WebGL texture
upload, and CSS/SVG image consumers. ImmutableBitmap remains only at
the legacy boundaries that still need it, such as HTML video snapshots
and callers that explicitly ask for a bitmap snapshot.

This keeps color-space ownership with the decoded frame while making
the expensive or legacy ImmutableBitmap path explicit at the few call
sites that still need it.
2026-05-05 14:39:17 -05:00
rgret-dev
19e74815ed UI/Gtk: Support keypad buttons for zoom actions
The Qt UI supports this so GTK should have it, too :^)
2026-05-03 17:08:34 +02:00
Johan Dahlin
1454e90c93 Meta: Add vcpkg overlay port for pdf.js 5.6.205 2026-04-30 07:46:12 +02:00
Johan Dahlin
70b74d3f17 UI/Gtk: Fix wheel scroll position on Wayland
GDK4 scroll events do not carry reliable pointer coordinates on Wayland
(gdk_event_get_position returns INT_MIN). Track the last known pointer
position from the motion controller and use it when building the wheel
event, matching the approach used by WebKit GTK.

This fixes mouse-wheel scrolling and scrollbar interaction in pages
with overflow containers such as the pdf.js viewer.
2026-04-27 17:54:24 -04:00
Luke Wilde
5d38e37a53 UI/AppKit: Add missing AutocompleteRowModel text field initializer 2026-04-25 08:47:15 +02:00
Timothy Flynn
fdbdb0ecd2 LibWebView+UI: Show an error page when we cannot sanitize a URL
Previously, if search was disabled, entering non-URL text would just
silently drop the search query (and on Qt, we would reload the current
URL). We now detect that the query did not result in a navigation and
load an error page instead, which directs the user to enable search.
2026-04-24 20:17:23 +02:00
Timothy Flynn
06796f5f7f LibURL+LibWeb+LibWebView: Convert about:version to a proper WebUI
Passing the browser command line and executable path to every WebContent
process just in case we load about:version always felt a bit weird. We
now use the WebUI framework to load this information on demand.
2026-04-21 06:59:11 -04:00
Undefine
61c9e819bb Meta: Replace the Android BuildLagomTools.sh script with Python code
There weren't many changes required to integrate it with ladybird.py
and that seems much cleaner.
2026-04-20 16:41:29 -06:00
Timothy Flynn
66cc1ef20b Meta: Use find_compiler.sh in fuzzer builder script
In commit b9c6263408, I had forgotten we
had this wrapper script to handle the eval magic for us. We just need
to forward the --clang-only argument to the underlying python script.
2026-04-20 13:17:06 -04:00
Timothy Flynn
dfeb1e6b98 UI/Qt: Adjust color of autocomplete title and header rows
The previous color was a bit difficult to read.
2026-04-17 18:50:59 +02:00
Johan Dahlin
0a00a5d61a UI/Gtk: Add browser window, tabs, menus, and dialogs
Add the complete browser UI:
- BrowserWindow: AdwHeaderBar with navigation, tab management via
  AdwTabView/AdwTabBar, find-in-page, fullscreen, zoom, D-Bus
  single-instance with open/activate handlers
- Tab: WebContentView lifecycle, ViewImplementation callbacks for
  title, URL, favicon, cursor, tooltips, dialogs, window management
- LadybirdBrowserWindow: GtkBuilder template widget with toolbar,
  tab bar, find bar, devtools banner, and hamburger menu
- LadybirdLocationEntry: URL entry with autocomplete, domain
  highlighting, and security icon
- Menu: GAction-based context menus and application menu with
  keyboard accelerators
- Dialogs: JS alert/confirm/prompt (AdwAlertDialog), color picker,
  file picker, select dropdown, download save dialog, toast
- GtkBuilder .ui resources for browser window, location entry
  completions, and list popovers

Updates Application and main.cpp to create browser windows and
handle D-Bus activation from remote instances.
2026-04-17 11:17:56 -04:00
Johan Dahlin
2573aff090 UI/Gtk: Add input events and WebContentView
Add the web content rendering surface and input handling:
- Events: GDK keyboard, mouse, and scroll event
  translation to Web::KeyEvent/MouseEvent
- WebContentView: ViewImplementation backed by
  GdkMemoryTextureBuilder with incremental update hints,
  enqueue_native_event helpers for mouse/key events
- LadybirdWebView: Custom GtkWidget with focus, key,
  click, motion, and scroll controllers
- Builder.h: Typed GtkBuilder object lookup helper
2026-04-17 11:17:56 -04:00
Johan Dahlin
e8be4a88d9 UI/Gtk: Add GLib event loop integration and application entry point
Add the core infrastructure for the GTK frontend:
- EventLoopImplementationGtk: GLib main loop integration with
  Core::EventLoop, timers, notifiers, and signal handling
- GObjectPtr RAII wrapper for GObject lifecycle management
- Application subclass with AdwApplication and D-Bus registration
- Minimal main.cpp entry point

The application starts and runs the event loop but does not yet
open any windows.
2026-04-17 11:17:56 -04:00
Andreas Kling
71d92c7298 UI/AppKit: Restore focus when activating a tab
Tabs opened from links on AppKit can be created before their URL is
loaded. That left background open-url tabs with the location field as
their stored responder, so switching to them later restored address-bar
focus instead of web content focus.

Track each tab's preferred responder, restore it when AppKit makes
the tab key, and mark page-backed open-url tabs to prefer the web view.
Blank new-tab pages still keep the location field focused.
2026-04-17 08:06:24 +02:00
Andreas Kling
1572429541 UI/Qt: Restore focus when activating a tab
Restore the active tab's remembered focus widget when switching tabs.
If the tab has no remembered focused child, fall back to the web
view so keyboard scrolling works immediately in tabs opened from
links.

This keeps the existing new-tab location bar behavior while making
background-opened pages respond to keyboard inputs as soon as they
are activated.
2026-04-17 08:06:24 +02:00
Andreas Kling
586da4e610 LibWebView: Add a "Search with <engine>" autocomplete row
Synthesize an extra AutocompleteSuggestion at the top of the Search
Suggestions section whenever there is a configured search engine and
the typed query is not URL-shaped.

Use the query as the row's primary text, carry a "Search with <engine>"
subtitle, and render that subtitle in the AppKit and Qt popups so the
explicit search fallback stays visible and readable even when history
fills the list.
2026-04-16 21:01:28 +02:00
Andreas Kling
bb9f789eae UI/Qt: Show rich, history-backed address bar autocomplete
Replace the old QCompleter-based popup with a custom list that renders
AutocompleteSuggestion rows with titles/URLs/section headers/favicons.

Parent the popup inside the window so it does not steal focus, route
keyboard and mouse activation through WebView::Autocomplete, and add
inline completion with backspace suppression and top-row selection.
2026-04-16 21:01:28 +02:00
Andreas Kling
1802a05bc2 UI/AppKit: Show rich autocomplete suggestion rows
Render AutocompleteSuggestion rows with section headers, favicons,
titles, and secondary text in the child-window popup instead of just
plain strings.

Move the AppKit popup and inline completion onto the shared suggestion
model, and share the base64 PNG decoding helper with the application
menu icon loading path.
2026-04-16 21:01:28 +02:00
Andreas Kling
4121b7c0d0 UI/AppKit: Show autocomplete in a child window
Replace the AppKit popover because it becomes key and steals focus from
the location field while suggestions are visible. Use a borderless
child window anchored to the toolbar item instead, and dismiss it on
resize or focus changes so the browser chrome stays predictable.
2026-04-16 21:01:28 +02:00
Andreas Kling
fe2cab9270 LibWebView: Add history-backed location autocomplete
Teach LibWebView autocomplete to query HistoryStore before falling back
to remote engines and move the wiring out of the AppKit frontend.
Refine matching so scheme and www. boilerplate do not dominate results,
short title and substring queries stay quiet, and history tracing can
explain what the ranking code is doing.
2026-04-16 21:01:28 +02:00
CalebC48
c35c29993a UI/Qt: Pass new tab page URL when creating a new window 2026-04-15 15:12:01 -04:00
Timothy Flynn
79893b9cef LibWeb+LibWebView+WebContent: Add a setting to control autoscrolling 2026-04-13 13:01:45 -04:00
Andreas Kling
2ca7dfa649 LibJS: Move bytecode interpreter state to VM
The bytecode interpreter only needed the running execution context,
but still threaded a separate Interpreter object through both the C++
and asm entry points. Move that state and the bytecode execution
helpers onto VM instead, and teach the asm generator and slow paths to
use VM directly.
2026-04-13 18:29:43 +02:00
ayeteadoe
e3c2393d96 UI/Qt: Implement register_process for Qt Windows event loop
Qt does not use IOCP's in their underlying Windows event loop
implementation; however, QWinEventNotifier allows us to register a wait
on a process handle that has SYNCHRONIZE access rights. This means an
event will be signalled when that process terminates which emits the
QWinEventNotifier::activated signal.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2026-04-12 16:08:07 +02:00
Timothy Flynn
b544e42809 LibWebView+UI: Add an about:bookmarks page to manage bookmarks
This page renders the bookmarks as a tree and hook context menu events
up to the UI's bookmarks bar context menus to allow editing bookmarks.
Users can also drag-and-drop bookmark items around.
2026-04-09 10:08:06 -04:00
Timothy Flynn
cd76622452 UI/Qt: Close all open bookmark menus when the bookmarks change
Qt will leave any existing menu open, which may be stale. We already do
the same in AppKit.
2026-04-09 10:08:06 -04:00
Timothy Flynn
6bf2279dfe Base: Extract some about:settings CSS classes to a common file
We will re-use the card classes in about:bookmarks.
2026-04-09 10:08:06 -04:00
Aliaksandr Kalenik
75af441bff Everywhere: Replace SharedBackingStore with Gfx::SharedImage
Generalize the backing store sharing abstraction into SharedImage, which
represents shared GPU memory independently of Skia and can be used to
share memory between different processes or different GPU contexts.
2026-04-09 01:18:59 +02:00
Timothy Flynn
22dc7808ae UI/AppKit: Handle cmd+left mouse clicks on bookmarks 2026-04-04 10:23:06 -04:00
Timothy Flynn
f69ed86da6 UI/AppKit: Rename a couple bookmarks bar fields to match Qt
AppKit doesn't need the bookmarks bar reorganization that Qt needed to
handle more mouse events. But let's rename these member fields to match
what they are now called in Qt.
2026-04-04 10:23:06 -04:00
Timothy Flynn
0b36c867f9 UI/Qt: Handle middle and ctrl+left mouse clicks on bookmarks 2026-04-04 10:23:06 -04:00
Timothy Flynn
6e75c40233 UI/Qt: Reorganize bookmark bar mouse event handling a bit
No functional change. This is just to make it simpler to add handling of
middle and ctrl+left mouse clicks.
2026-04-04 10:23:06 -04:00
Timothy Flynn
ef4ff5d490 LibWebView+UI: Centralize option to treat file:// URLs as non-opaque 2026-04-02 10:21:15 +02:00
Jonathan
bbb6653c4f UI/Qt: Add Ctrl+Tab and Ctrl+Shift+Tab for tab navigation
In addition to Ctrl+PageDown and Ctrl+PageUp, also support Ctrl+Tab and
Ctrl+Shift+Tab to switch between browser tabs. This is the common
behavior in other browsers.
2026-04-01 11:53:15 +01:00
Timothy Flynn
e23a894c2a UI/AppKit: Integrate bookmark context menus into the bookmarks bar 2026-04-01 04:57:28 +02:00
Timothy Flynn
81c2426b03 UI/AppKit: Create custom popup views for bookmarks bar folders
Unfortunately, the NSMenu-based bookmarks implementation cannot support
context menus within arbitrary folders. The NSMenu consumes the right-
click events during its own menu tracking, and we are not able to see
those events from our interface.

This patch replaces the NSMenu for folders with a custom NSPopup. This
implementation makes it much easier to handle context menus.
2026-04-01 04:57:28 +02:00
Timothy Flynn
d8fb0ed59a UI/Qt: Integrate bookmark context menus into the bookmarks bar 2026-04-01 04:57:28 +02:00
Undefine
829d112327 Meta: Move Lagom CMakeLists stuff to the top level CMakeLists
This allows us to get rid of the annoying Build/.../Lagom directory
and helps to deduplicate a bunch of logic while also drastically
simplifying everything.
2026-03-29 13:59:11 -06:00
Undefine
fbbcc73fea Meta: Refactor the way the GUI framework is picked
This is largely based of off the work done by Andrew Kaster in #5918.
Having this toggle makes much more sense, especially if there will be
more UIs in the future.

Co-authored-by: Andrew Kaster <andrew@ladybird.org>
2026-03-29 13:59:11 -06:00
Undefine
4eda70a4f1 Meta: Move the Qt6 dependency stuff to the Qt UI CMake
Instead of this awkward place let's move it to the Qt UI CMakeLists,
which makes much more sense for stuff like this.
2026-03-29 13:59:11 -06:00
Timothy Flynn
2b9cce8f62 UI/Qt: Create a bookmarks application menu and toolbar 2026-03-24 12:04:50 -04:00
Timothy Flynn
a0d9c6f0a9 UI/AppKit: Create a bookmarks application menu and toolbar 2026-03-24 12:04:50 -04:00
Timothy Flynn
a4ed90a482 UI/AppKit: Ensure application action observers are removed
In AppKit, we were never calling Action::remove_observer.
2026-03-24 12:04:50 -04:00
Timothy Flynn
afcc0fdbb0 LibWebView+UI: Add option to render an icon for application submenus 2026-03-24 12:04:50 -04:00
Timothy Flynn
0a3e2196c9 UI/Qt: Store the TabWidget parent directly on TabBar
The parent owner of the TabBar changes as it is added to layout objects
within other widgets. So the parent we set at the beginning is no longer
the parent when we right-click on a tab. We now just store the TabWidget
directly.
2026-03-22 18:36:36 -04:00
Timothy Flynn
7e3bb9d984 UI/Qt: Replace QTabWidget with a custom TabWidget composition
QTabWidget's built-in tab bar management made it difficult to properly
position the new tab button, and caused visual artifacts with the
separator line across themes.

Replace QTabWidget with a custom TabWidget that places a QTabBar
alongside an explicit new tab button. This us gives full control over
the tab bar row layout.
2026-03-18 18:39:53 -04:00
Timothy Flynn
7b78d3786e UI/AppKit: Set an initial intrinsic size for the location search field
We initially create the search field with no frame or size constraints.
The causes AppKit to log verbose warnings at start up. Here, we set an
intrinsic size initially, which becomes overridden once the window has
an actual size.
2026-03-18 18:04:01 -04:00
Zaggy1024
ac69815740 Everywhere: Add an is_fullscreen parameter to set_viewport
This will be used by the UIs to notify WebContent when fullscreen for
content is entered or exited.
2026-03-17 18:58:37 -05:00
Zaggy1024
1ceb012100 UI/AppKit: Don't call fully_exit_fullscreen() if WebContent initiated
This is a no-op on the WebContent side if it asked the UI to exit
fullscreen.
2026-03-17 18:58:37 -05:00
Zaggy1024
d22bd7334a UI/Qt: Don't trigger fully_exit_fullscreen() when WebContent initiated
If WebContent requested a fullscreen exit, then this is a no-op anyway.
2026-03-17 18:58:37 -05:00
Timothy Flynn
ebaad09b1b UI/Qt: Correctly adjust hamburger menu positioning on first open
The HamburgerMenu subclass overrode showEvent() to reposition the menu
using move() after QMenu::popup() had already shown it. On the first
open, rect().width() could return a stale value, causing the menu to
appear detached from the button and truncated to a single item. The
move() call also bypassed Qt's screen boundary adjustments.

Instead, we can replace the HamburgerMenu with a normal QMenu, and use a
custom HamburgerButton class for the menu's tool button. In this class,
we override mousePressEvent() to call popup() with the correct right-
aligned position before the menu is shown. This lets Qt manage sizing
and screen boundaries correctly.
2026-03-17 07:12:05 -04:00
Zaggy1024
07cf09a0f2 UI/AppKit+LibWeb: Handle the Ctrl+click context menu in EventHandler
Changing Ctrl+click to a secondary click is incorrect. It prevents
sites from using Ctrl+click themselves. Instead, just maybe open the
context menu in mousedown for primary clicks with Ctrl pressed.

Fixes the autofire shortcut not working in the Humble Mozilla Bundle's
asm.js FTL.
2026-03-17 04:01:29 -05:00
Zaggy1024
6c73323732 UI/Qt: Store the click count as int to match UIEvent.detail's type
Also, ensure that it never goes below 0.
2026-03-17 04:01:29 -05:00
Zaggy1024
a51967311e Everywhere: Consolidate double/triple click handling to use click count
This moves normal/double/triple click checking into WebContent, the
client only has to send a click count in order to activate a double
or triple click in the content. This means that the AppKit UI will no
longer fire multiple double clicks when clicking in place more than 3
times. This matches the behavior of other browsers on macOS.

We will now also fire the click event regardless of whether a dblclick
event will follow, as the spec requires.
2026-03-17 04:01:29 -05:00
Timothy Flynn
b9c71df147 UI/AppKit: Hide the location bar when elements are fullscreened
When an element is fullscreened, we now hide the application menu and
location bar. The user can hover over the top of the window to make
them show. When fullscreen is requested for the application directly
from the UI, we do not hide the location bar. This matches Safari's
behavior.
2026-03-05 10:00:12 -05:00
Timothy Flynn
ae8181b467 LibWeb+LibWebView+UI: Add a context menu item to toggle fullscreen state 2026-03-01 15:41:43 -06:00
Zaggy1024
e77167f2f4 UI/AppKit: Make CPU painting work again
We were incorrectly calling presentMetalFrame while force-cpu-painting
was enabled, so updateLayer never had any chance to be called.

However, in addition to that, it turned out that there's a subclass of
CALayer that is used by NSView by default which cannot be created in a
makeBackingLayer override, so updateLayer was never going to be called
anyway. In order to update the layer at the requisite time, a new
LadybirdWebViewContentLayer had to be added to simply call the delegate
on our view.

Setting the contentsRect on the layer was also incorrect, and caused
the contents to shift and stretch until WebContent's backing stores
shrank to fit the new view size.
2026-03-01 08:32:36 +01:00
Andreas Kling
b20d14970f LibWeb: Flatten Platform::FontPlugin by merging WebView::FontPlugin
WebView::FontPlugin was the only implementation of the abstract
FontPlugin base class. Its dependencies (LibGfx, LibCore) are
already visible to LibWeb.

Remove the virtual dispatch by making FontPlugin concrete and
absorbing the WebView::FontPlugin implementation directly.
2026-02-28 15:32:14 +01:00
Andreas Kling
3cfc7aa629 LibWeb: Flatten Platform::EventLoopPlugin by merging Serenity impl
EventLoopPluginSerenity was the only implementation of the abstract
EventLoopPlugin base class. Its methods simply wrapped Core::EventLoop
calls with GC function unwrapping.

Remove the virtual dispatch by making EventLoopPlugin concrete and
absorbing the EventLoopPluginSerenity implementation directly.
2026-02-28 15:32:14 +01:00
Luke Wilde
1d34abd96f UI/AppKit: Implement exiting fullscreen 2026-02-23 18:44:26 +00:00
Simon Farre
25eef2e6e6 UI/Qt: Add interface for exiting fullscreen
This adds the following features to the Qt UI:
- An "exit fullscreen" button that displays when entering fullscreen
  This will disappear after a certain amount of time. Moving the
  cursor to the top of the screen will make it reappear.
- Switching tabs exits fullscreen

The look and feel of this is preliminary and should be expanded upon
in the future.
2026-02-23 18:44:26 +00:00
Simon Farre
44e0735d9b LibWebView+UI/Qt: Allow WebContent to enter/exit the fullscreen UI
These IPC methods should be expanded in the future to allow WebContent
to specify what UI elements should be kept/removed, for example, the
navigation UI.
2026-02-23 18:44:26 +00:00
Jelle Raaijmakers
1cc29c669a WebContent: Combine viewport size and DPR into a single IPC message
The set_viewport_size and set_device_pixel_ratio IPC messages were sent
separately, potentially causing a race condition when the DPR changes
(e.g. moving a window between screens): the DPR message would arrive
and use a stale viewport size, computing a temporarily wrong CSS
viewport. Combine both into a single set_viewport IPC that updates the
device viewport size and DPR together.
2026-02-23 15:22:12 +01:00
Shannon Booth
1be69479a6 LibURL+Elsewhere: Consider file:// origins opaque by default
This aligns our behaviour closer to other browsers, which
_mostly_ consider file scheme URLs as opaque. For test
purposes, allow overriding this behaviour with a commandline
flag.
2026-02-21 23:00:57 +01:00
Timothy Flynn
ea32502947 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-21 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")
2026-02-18 08:02:45 -05:00
Luke Wilde
0e958ca8d5 LibWebView+UI/AppKit: Present IOSurfaces directly
Instead of copying the Bitmap that wraps the IOSurface, we can just
present the IOSurface directly. This significantly reduces CPU usage in
the UI process, particularly at high refresh rates such as 120Hz where
it would saturate a full CPU core.

This is done by using CAMetalLayer and blitting the IOSurface to the
next drawable buffer, which handles triple buffering, locking the
IOSurface and vsync automatically. This also allows the Metal HUD to
work, but the only accurate stat is the frame intervals/FPS because
it's in the UI layer, not WebContent. However, that's still useful
to detect frame drops.
2026-02-16 14:57:17 +00:00
Luke Wilde
891af6a6a5 UI/Qt: Request closure instead of always force closing tabs 2026-02-14 23:26:10 +00:00