Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wayland: reimplement maximize and restore #6383

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

devmatteini
Copy link
Contributor

Hi!

Reimplement maximize and restore features for wayland.
It was removed with wayland reimplementation in #4777. I backported maximize and restore as before that PR was merged.

It partially fixes #6203, but I didn't check toggle_fullscreen behavior.

The only issue that I noticed is that sometimes after you invoke win:restore() wezterm window doesn't restore until you focus another application.

Configuration file for tests:

local wezterm = require "wezterm"

local config = {}

wezterm.on("gui-startup", function()
  local mux = wezterm.mux
  local tab, main_pane, main_window = mux.spawn_window {}
  main_window:gui_window():maximize()
end)

config.keys = {
  {
    key = "r",
    mods = "CTRL|SHIFT",
    action = wezterm.action_callback(function(win, pane)
      wezterm.log_info 'Restore window'
      win:restore()
    end),
  },
  {
    key = "m",
    mods = "CTRL|SHIFT",
    action = wezterm.action_callback(function(win, pane)
      wezterm.log_info 'Maximize window'
      win:maximize()
    end),
  },
}

return config

Tested on Ubuntu 24.04.1 with GNOME 46.

It was removed with wayland reimplementation in wez#4777
@wez wez merged commit a7ff718 into wez:main Nov 28, 2024
1 check was pending
@wez
Copy link
Owner

wez commented Nov 28, 2024

Thank you!

@Felixoid
Copy link

Dear @devmatteini, it didn't fix the gap, unfortunately

@devmatteini
Copy link
Contributor Author

@Felixoid can you share your configuration file?

I didn't have any gap while testing these changes. It might be unrelated to maximize

@Felixoid
Copy link

Felixoid commented Nov 29, 2024

wezterm -n is used for tests

image

@devmatteini
Copy link
Contributor Author

I can't reproduce the gap issue @Felixoid. Which linux distro and desktop environment are you using?

@wez
Copy link
Owner

wez commented Nov 29, 2024

That weird W icon is the fallback wayland icon that shows up when fractional scaling is used because the compositor does some kind of proxy window. In that circumstance I wouldn't be surprised if some of the metrics are out of whack.
The issue that this PR resolves is that the maximize and restore functions did nothing. They are now connected to the correct operation. I think the issue that felixoid is encountering is that the maximize function has some glitches in their environment: technically a separate issue from what was fixed here.

@devmatteini
Copy link
Contributor Author

Thanks for the useful information! I totally agree with you

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.

Maximize is not working and fullscreen is not fullscreen
3 participants