hardpixel / unite-shell

Unite is an extension that makes GNOME Shell look like Ubuntu Unity Shell.
GNU General Public License v3.0
948 stars 62 forks source link

Multi monitor support for client side window decorations (CSD) #74

Open goodwillcoding opened 6 years ago

goodwillcoding commented 6 years ago

It appears that some of the types (Gedit, Gnome tweak) of window when maximized on a non-primary monitor still remove the close maximize buttons. By comparisson applicaitons with older style title bars (gnome-terminal, firefox) work just fine. Screenshots below are taken on the secondary monitor.

Gnome terminal (has buttons): image

Gnome tweaks (does not): image

I've been looking over the code and so far have not pinpointed the issue (potentially maybe Helper.isValid). If you can point to me in the right directly I am happy to do a PR.

goodwillcoding commented 6 years ago

Update.

I located the the cause of the problem, specifically in my case buttons-left.css hides the headerbar box my moving it off screen, which applies to ALL windows, rather then just the primary one.

.maximized headerbar > box.left,
.maximized .titlebar > box.left {
  margin: 0 0 0 -200px;
  opacity: 0;

Have not looked at tiles and right orientation but my guess there is the same problem there. The "No Title Bar" extensions solved this by never hiding the close/minimize/maximize buttons using this CSS fix, there there is no simple fix here. My guess, style would have to be applied conditionally to each window to avoid this issue.

Or to have Unite handle cloned top bar (in my case via "Multi Monitors Add-On" extension). On overall thought this is a Gnome problem since it gives no good API for handling multiple topbars. Partly covered here #61.

Only solution "simple solution" I see here is to have multiple css files which do not have this css if there are multiple monitors ... which is an inconsistent behaviour.

jonian commented 5 years ago

Hi @goodwillcoding, thank you for your input. This is a known issue as you can see on #14. I will mark the other issue as a duplicate, since it does not have any info.

I will add soon another comment about the possible solutions.

goodwillcoding commented 5 years ago

@jonian I've been playing with various solutions, no luck yet. Though that might be due to my lack of knowledge of gnome shell css/js tricks. If you have idea and some rough code to point at I will take a swing at this.

goodwillcoding commented 5 years ago

@jonian as a thought, do you think it makes sense to take out the offending css out. Here is my rationale:

  1. on single monitors the title bar for such apps does not get remove anyhow since it contains other elements
  2. On multiple monitors it will avoid this issue

Obvious downside is that on the single monitor there will be 2 sets of close/minimize/maximize buttons

satriani-vai commented 5 years ago

Is there already a solution?

MateuszKubuszok commented 5 years ago

I'll leave here the same commend I did under GTKTitleBar:

I tested that in my case worked this CSS - I just changed windows.ssd to window.ssd.maximized and now I have title bar removed in all monitors:

window.ssd.maximized separator:first-child + headerbar:backdrop,
window.ssd.maximized separator:first-child + headerbar,
window.ssd.maximized headerbar:first-child:backdrop,
window.ssd.maximized headerbar:first-child,
window.ssd.maximized headerbar:last-child:backdrop,
window.ssd.maximized headerbar:last-child,
window.ssd.maximized stack headerbar:first-child:backdrop,
window.ssd.maximized stack headerbar:first-child,
window.ssd.maximized stack headerbar:last-child:backdrop,
window.ssd.maximized stack headerbar:last-child,
window.ssd.maximized decoration,
window.ssd.maximized headerbar.titlebar {
  border-radius: 0;
}

window.ssd.maximized headerbar * {
  margin-top: -100px;
  color: #1c2022;
}

window.ssd.maximized headerbar.titlebar,
window.ssd.maximized headerbar.titlebar button.titlebutton {
  border: none;
  font-size: 0;
  height: 0;
  margin: 0;
  max-height: 0;
  min-height: 0;
  padding: 0;
}

I am certain that there is redundancy in this CSS, but I can tell that it worked for me in this form. The only issue is that non-maximized windows have title bars with no text but I can live with that.

satriani-vai commented 5 years ago

buttons_issue

jonian commented 4 years ago

There are two possible solutions to fix this issue:

  1. Add top panel in all screens #148
  2. Add support for multi-monitors extension #19
Gideon-Felt commented 4 years ago

Is there no patch for this yet? I use Multi Monitors Add-On would very much like for this to be working like on the original unity.

Jhackler commented 3 years ago

I would really just like to have a top panel on all screen that this maximizes into

stdedos commented 2 years ago

There are two possible solutions to fix this issue:

  1. Add top panel in all screens Title Bar on second screen #148
  2. Add support for multi-monitors extension Conflict issues between this plugin and the multi-monitors extension #19

I am not sure how well does the Multi-monitor extension work (I am using https://extensions.gnome.org/extension/921/multi-monitors-add-on/; is this the one referenced?). If that's the one, it's not working for me - whereas "Unite" works so far so good in Ubuntu Focal. If Unite would like to give a "full" experience, fixing Multi-monitor or plain cloning it here might be necessary (AFAIU option 1?)

Jhackler commented 2 years ago

Is it at all possible to ad option to the extensions to display top panel on all monitors. It is really annoying that I cant have a top panel on multiple screens