Skip to content

feat(window): add command to set fullscreen on specific monitor#14926

Open
Oscar3170 wants to merge 1 commit into
tauri-apps:devfrom
Oscar3170:feat/set-fullscreen-on-monitor
Open

feat(window): add command to set fullscreen on specific monitor#14926
Oscar3170 wants to merge 1 commit into
tauri-apps:devfrom
Oscar3170:feat/set-fullscreen-on-monitor

Conversation

@Oscar3170
Copy link
Copy Markdown

Add a new command to the window core plugin set_fullscreen_on_monitor which receives a position and sets the window as fullscreen on the monitor that contains the position.

Since tao already exposes a way to specify the monitor for the fullscreen function, it was only necessary to expose this parameter in the tauri-runtime-wry and window plugin.

Since monitor names are not unique the new function needs the monitor's position to know which monitor we actually want.

This is the most useful on wayland systems, since the window can't move itself any other way, and this at least gives an option for applications that need to be fullscreen.

Workaround for issues: #14019 and #7376.

@Oscar3170 Oscar3170 requested a review from a team as a code owner February 11, 2026 15:06
@Oscar3170
Copy link
Copy Markdown
Author

Oscar3170 commented Feb 11, 2026

The naming and function parameters could cause confusion, since the other set_fullscreen functions can set the fullscreen state on or off, while this new function only sets fullscreen on.

I figured it would be best to leave the job of turning off the fullscreen state to the regular set_fullscreen function, since the monitor is irrelevant in this case.

Be free to give feedback on if I should change the name or add a bool parameter to the function.

@Legend-Master Legend-Master added this to the 2.12 milestone Apr 29, 2026
@Qodo-Free-For-OSS
Copy link
Copy Markdown

Hi, SetFullscreenOnMonitor does nothing when monitor_from_point returns None, but the command still resolves successfully, so callers cannot detect failure or provide feedback.

Severity: action required | Category: correctness

How to fix: Return error when monitor missing

Agent prompt to fix - you can give this to your LLM of choice:

Issue description

set_fullscreen_on_monitor currently succeeds even when no monitor is found for the provided point, causing a silent no-op.

Issue Context

The handler branches on if let Some(monitor) and otherwise does nothing. Since the dispatch path returns Ok(()) when the message is delivered, callers can't detect failure.

Fix Focus Areas

  • crates/tauri-runtime-wry/src/lib.rs[3433-3437]

Proposed fix

Change the handler to emit a warning and/or surface a failure back to the caller. Options:

  • Convert this message to a request/response pattern (like other getters) returning Result<()> through a channel, and return Err(Error::FailedToGetMonitor) when monitor_from_point is None.
  • If you want to keep fire-and-forget semantics, at minimum log a warning when monitor_from_point is None so the failure is observable.

We noticed a couple of other issues in this PR as well - happy to share if helpful.


Qodo code review - free for open-source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants