zed icon indicating copy to clipboard operation
zed copied to clipboard

Title bar becomes transparent when focus switches to second monitor (Ubuntu)

Open dushmanta05 opened this issue 1 year ago • 6 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

I'm experiencing an issue with the Zed editor on my Ubuntu device when using dual monitors. The problem occurs as follows:

  • I have Zed editor open on my primary monitor (my laptop screen).
  • When my pointer is focused on the Zed editor, everything displays correctly.
  • However, when I switch focus to the second monitor, the Zed editor's title bar on the primary monitor becomes transparent.
  • This transparency causes the title bar to show the other window(s) behind it on the primary monitor.
  • The issue resolves when I refocus on the Zed editor on the primary monitor.

Steps to reproduce:

  • Open Zed editor on the primary monitor.
  • Open another application or window on the same monitor.
  • Switch focus to the second monitor.
  • Observe the Zed editor's title bar on the primary monitor.

Environment

System: Host: dushmanta Kernel: 6.8.0-41-generic arch: x86_64 bits: 64 compiler: gcc v: 13.2.0 Desktop: GNOME v: 46.0 Distro: Ubuntu 24.04 LTS (Noble Numbat) Display: Wayland

Zed: Version: 0.149.03

If applicable, add mockups / screenshots to help explain present your vision of the feature

Here's how Zed looks on the primary monitor, as mentioned above

Primary monitor

This is how Zed looks when focus is on the 2nd monitor

Second monitor

If applicable, attach your Zed.log file to this issue.

Zed.log

dushmanta05 avatar Aug 22 '24 20:08 dushmanta05

In Fedora 40 (gnome) too!

tassianoalencar avatar Aug 22 '24 20:08 tassianoalencar

This could be a theme-related issue. What theme are you using? 🙂

apricotbucket28 avatar Aug 22 '24 20:08 apricotbucket28

@apricotbucket28 By theme, are you asking x11 or wayland? or is it something else? I've got pure Ubuntu with Wayland and no other theme.

dushmanta05 avatar Aug 23 '24 05:08 dushmanta05

@apricotbucket28 By theme, are you asking x11 or wayland? or is it something else? I've got pure Ubuntu with Wayland and no other theme.

By theme I mean the Zed theme.

apricotbucket28 avatar Aug 23 '24 10:08 apricotbucket28

@apricotbucket28 Ah sorry, I misunderstood, I'm using GitHub Dark Default theme currently

dushmanta05 avatar Aug 23 '24 19:08 dushmanta05

Thanks for the reply! I looked at the theme and it seems like it doesn't set the title_bar.inactive_background color key.

However, this should have been fixed from even happening in https://github.com/zed-industries/zed/pull/15709. But it seems there are two more fallback places where the default color has to be changed from a transparent value to non-transparent: https://github.com/zed-industries/zed/blob/df2ffaaf77df339bfefc0078d100d7140340a1ba/crates/theme/src/default_colors.rs#L53 and https://github.com/zed-industries/zed/blob/df2ffaaf77df339bfefc0078d100d7140340a1ba/crates/theme/src/default_colors.rs#L151

So, basically:

  1. You should create an issue in the theme's repo kindly asking for title_bar.inactive_background to be set.
  2. Zed should use a non-transparent fallback color when the key is missing; I'll see if I can fix this later.

apricotbucket28 avatar Aug 23 '24 20:08 apricotbucket28