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

Window overflows in Elementary OS Freya #200

Closed
finnbar opened this Issue May 31, 2016 · 19 comments

Comments

Projects
None yet
3 participants
@finnbar
Copy link

finnbar commented May 31, 2016

I don't know whether this is some weird Elementary OS thing, but whatever theme is set, the window seems to overflow to outside of the window controls. The window controls are still within the inside bit as well, it just seems to have some extra stuff on the outside. I've attached an image showing this.

screenshot from 2016-05-31 20 07 49

Sorry if this is an easily fixable user setting rather than an actual bug, I've just picked up Howl (and it's super nice!) and cloned it from the repo.

@nilnor

This comment has been minimized.

Copy link
Contributor

nilnor commented May 31, 2016

(I'm assuming you refer to the window's title bar extending past Howl's editor view - please correct me if I'm wrong).

This is not actually a bug per se, but a theming setting. The outer padding is an option in themes (defaulting to a little bit of padding), which typically works out well. For your setup not so much however since in this case a full width would blend in better (nice screenshot by the way).

It's unfortunately not an easily fixable user setting at this point. At some point in the future we'll add easy theme overriding, but until this is in place it's slightly more work to customize a theme. For this example (customizing the Monokai theme) you can do the following:

  • Copy the existing monokai theme file to your local ~/howl directory (cp bundles/howl-themes/monokai/monokai.moon ~/.howl/monokai-custom.moon from within the Howl directory)
  • Modify the theme settings to your liking. In this case you would add outer_padding: 0 under the window: section, like so:
  window:
    outer_padding: 0
  • Tell Howl to use your new customized theme in your init file (~/.howl/init.moon or ~/.howl/init.lua). Here's a snippet that should work regardless of whether you're using Lua or Moonscript:
howl.ui.theme.register('Monokai Custom', user_file('monokai-custom.moon'))
howl.config.theme = 'Monokai Custom

Let me know how it works out for you!

@kirbyfan64

This comment has been minimized.

Copy link
Contributor

kirbyfan64 commented May 31, 2016

@nilnor I thought the issue was referring to the giant black box outside of the window?

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

@kirbyfan64 Yes, I was referring to the black box, although I'm going to try @nilnor 's fix. Weirdly when opening a file in Howl by right-clicking in Files and selecting "open with Howl", the box disappears. I've got no idea what's happening there, but I'll report back on trying the fix.

@nilnor

This comment has been minimized.

Copy link
Contributor

nilnor commented May 31, 2016

@finnbar All right, so that's weird then (and in that case you can ignore the other suggestion). That padding is completely outside of the entire actual window (including the window decorations). How does it look with other themes, is the padding always black or does it change with themes?

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

@nilnor The padding matches the theme seamlessly. Here's another nice screenshot:

screenshot from 2016-05-31 21 00 58

@nilnor

This comment has been minimized.

Copy link
Contributor

nilnor commented May 31, 2016

Some searching indicates this might be a fairly common problem with Gtk3 apps and certain window managers. See for instance numixproject/numix-gtk-theme#206 and http://www.webupd8.org/2015/11/fix-large-black-borders-around-header.html.

They talk about work-arounds with overriding Gtk style settings in the home dir, so you could try that and it might fix it. However, I would like to know if this is something we can work around directly in Howl as well, so if you have the time it would be great if you could try modifying the lib/howl/ui/theme.moon file in Howl and add the following within the css_template definition:

.window-frame {
  box-shadow: none;
  margin: 0;
}

Either edit the file with Howl itself, or run make again in the scr directory afterwards, and see if that has any effect?

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

That makes sense, thank you for taking your time to work out what's going on!
I added that to the definition then remade Howl, then a few weird things happened. I also undid the change, and the same weird things happened.

If I run howl either by clicking its executable or when I right-click a file in my file manager and select "Open with Howl", it works perfectly and the box doesn't appear. If I run the command "howl" in the terminal or click its .desktop file (which just runs "howl"), the weird box appears. Is there anything in the make install that would cause stuff to be weird like this?

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

I think for now I'll just modify the .desktop to go with my user's executable (rather than the one created by sudo make install) as a temporary fix, but I'll keep an eye out. Thank you for all of your help!

EDIT: Pantheon Files must be doing something, because that didn't fix it. I'll keep looking into it.

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

Okay, you're magic. This works a treat! I have no idea what was happening before, but it's all working now. I must have missed a make or sudo make install somewhere.

@finnbar finnbar closed this May 31, 2016

@nilnor

This comment has been minimized.

Copy link
Contributor

nilnor commented May 31, 2016

@finnbar Excellent, that's exactly what I want to hear before going to bed :)

Just to be clear, this was the addition in theme.moon? We'll add this to master later then and do a point release with the work-around afterwards.

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

Yes, it was exactly the fix you suggested, so I went into my howl folder, added that to css_template in lib/howl/ui/theme.moon, then ran make and sudo make install. So that's an easy fix to apply, although you might want to check it doesn't do anything silly in systems that it was already working in. But not tonight.

Goodnight. :)

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

I've just noticed this leaves us with a secondary problem, which I'm trying to fix now - with a border of zero, no window controls appear at all. So you can't resize the window by dragging. Setting it to 2px makes the border only a little annoying, while still letting the controls work. I'll see if I can make it better, if so, I'll let you know.

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

Well, I'm going to go to bed now. With the code below, all but the right window control are (mostly) accessible. I've added a tiny margin to the bottom, as that helps you grab the bottom control. I might have another look tomorrow, but I can't promise anything - but let me know if there's any way I can help!

.window-frame { box-shadow: none; margin: 0 0 2px 0; }

@kirbyfan64

This comment has been minimized.

Copy link
Contributor

kirbyfan64 commented May 31, 2016

@finnbar Well, goodnight then. :)

BUT...tomorrow, could you try .window-frame { box-shadow: none; margin: 15px; }?

@finnbar

This comment has been minimized.

Copy link

finnbar commented May 31, 2016

@kirbyfan64 Saw your message as I was packing up, so I thought I'd try it quickly. That creates a smaller version of the original problem. But it does make grabbing the window controls easier! Anyway, to bed for real this time. Goodnight. :)

@finnbar

This comment has been minimized.

Copy link

finnbar commented Jun 1, 2016

Just did some more experimenting - I can't seem to get it to be better than .window-frame { box-shadow: none; margin: 0 0 2px 0; }. This means that the right window resize control doesn't come up. Applying an overall margin of 1px creates a slight border while being able to resize stuff, so that might be a good compromise.

nilnor added a commit that referenced this issue Jun 1, 2016

Explicitly set Gtk window frame margin
Since some Gtk versions have problems with certain window managers, or the
other way around. For issue #200.
@nilnor

This comment has been minimized.

Copy link
Contributor

nilnor commented Jun 1, 2016

I committed a hybrid path with 1px margin for left and right, and 2px for the bottom where it's not so apparent. Noticed another problem when trying out Elementary, where the scrollbars ends up being effectively hidden since it clashes with the built-in theme, but will look at that later.

@finnbar

This comment has been minimized.

Copy link

finnbar commented Jun 1, 2016

That looks good! I don't have the problem you have with the scrollbars though - they seem to be there for me (or at least in Monokai).

@nilnor

This comment has been minimized.

Copy link
Contributor

nilnor commented Jun 1, 2016

Great! Re the scrollbars, they are there but for me with the Monokai theme they are effectively invisible since they're black on Freya, and looking at your first screenshot that seems to be the same there. So it's a color matching / theme thing that we need to fix (PR coming up later).

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