solus-project / budgie-desktop

I Tawt I Taw A Purdy Desktop
https://solus-project.com/
2.33k stars 158 forks source link

Icons with Qt backend have bigger space than needed #629

Open nazar-pc opened 8 years ago

nazar-pc commented 8 years ago

Operating System: Ubuntu 16.10 x64 Budgie version: Budgie 10.2.7

The issue encountered When using Qt icon backend icon have big space on the left and right side of it.

Initially reported in qTox repository: https://github.com/qTox/qTox/issues/3761, but really the problem is in Budgie panel and I believe it is not specific to OS.

Steps to reproduce the issue

  1. Have qTox compiled/installed
  2. Execute XDG_CURRENT_DESKTOP=Custom qtox (instead of Custom might be an empty string or something that qTox doesn't recognize in order to use Qt backend, see https://github.com/qTox/qTox/wiki/Tray-icon)
  3. Stop qTox
  4. Execute XDG_CURRENT_DESKTOP=GNOME qtox

Demo: https://owncloud.mokrynskyi.com/index.php/s/ZQxSuIv5hw5rlpr

nazar-pc commented 8 years ago

Interestingly, I don't see this issue when qTox starts on system boot

ikeydoherty commented 8 years ago

I don't understand why you're overriding XDG_CURRENT_DESKTOP

nazar-pc commented 8 years ago

Custom is my actual value of XDG_CURRENT_DESKTOP. I've added it to steps for reproducing so that you can force qTox to use Qt backend for drawing its icon to reproduce an issue reliably (mentioned wiki page describes why it is so).

ikeydoherty commented 8 years ago

o_O

 ikey@solus-bdw  ~  echo $XDG_CURRENT_DESKTOP 
Budgie:GNOME
 ikey@solus-bdw  ~  

Something's gone tits up if yours is Custom

nazar-pc commented 8 years ago

Sorry for confusion, it is not Budgie session actually, it is custom session made by me (I gave it name Custom) where I use awesome budgie-run-dialog and budgie-panel apps, but I'm not satisfied with WM even remotely, so I use Compiz and launcher is Plank, the same as Budgie Desktop defaults to.

Eventually the issue has nothing to do with XDG_CURRENT_DESKTOP itself, this is just a way to force qTox to use specific backend for drawing icon:)

nazar-pc commented 8 years ago

Well, I've actually modified desktop file used on boot, so the problem is 100% reproducible.

ikeydoherty commented 8 years ago

So you're not using full budgie, you use a custom session, no gnome session (mandatory ..), and you don't use the window manager...

You can see why this is hard for me to even begin thinking about :P

nazar-pc commented 8 years ago

I am using gnome-session-bin for running my session and keeping necessary components alive as well as few other necessary components (like polkit/keyring stuff, gnome settings daemon), I just don't like a lot of other stuff typical GNOME-inherited environment brings, so I deliberately changed session name so that only intentionally selected and/or truly generic packages start with session. This shows, however, some other issues potentially not visible for regular user like this one:)

ikeydoherty commented 8 years ago

Struggling to grasp why this is somehow a Budgie issue. That's an XEmbed window, belonging solely to qtox, sized by qtox, rendered by qtox, and done invalidly based on a decision you made to break it's integration...

Surely you should just create a wrapper for qtox to override the XDG_CURRENT_DESKTOP to something sane?

ikeydoherty commented 8 years ago

Note that longterm we'll be using app indicators which will be rendered only by Budgie, but for now the ball is in your court + qtox. There's literally nothing doable from the Budgie side

nazar-pc commented 8 years ago

I honestly don't know what happens under the hood and which side might need to fix sizing. @zetok, can you help here? If sizing is really made on qTox side, how can I debug why it happens incorrectly?

nazar-pc commented 8 years ago

I'm wondering if other apps with Qt backend will have similar issues. However, I have ownCloud with Qt 5.5.1 and it works perfectly without any tweaks. Not sure what Electron-based apps use, but all of them as well as Qt4 apps render icon correctly, only qTox is different and they say it is not their fault...

zetok commented 8 years ago

@ikeydoherty

Struggling to grasp why this is somehow a Budgie issue. That's an XEmbed window, belonging solely to qtox, sized by qtox, rendered by qtox, and done invalidly based on a decision you made to break it's integration...

Surely you should just create a wrapper for qtox to override the XDG_CURRENT_DESKTOP to something sane?

This has nothing to do with XDG_CURRENT_DESKTOP var. qTox checks it to see which tray backend should be used.

Thing is, there should be no reason for an app to use tray backend other than the default one provided by Qt. Sadly, DEs cannot into proper support for Qt tray backend, so qTox tries to detect which DE is being used and use tray backend that is least broken on given DE.

The problem here is that your DE doesn't have proper support for Qt tray backend. Steps posted by @nazar-pc are there just to force qTox to use default tray backend (Qt), which doesn't seem to work perfectly on your DE.

Qt tray backend on i3wm: spectacle sm5821, works as it should.

Not a real issue for users, since qTox does the sane thing and works around DEs that cannot into Qt tray support by checking XDG_CURRENT_DESKTOP, and providing tray backend that is least broken on detected DE.

@nazar-pc

I'm wondering if other apps with Qt backend will have similar issues. However, I have ownCloud with Qt 5.5.1 and it works perfectly without any tweaks. Not sure what Electron-based apps use, but all of them as well as Qt4 apps render icon correctly, only qTox is different and they say it is not their fault...

Do those apps use SVG for tray icon?

nazar-pc commented 8 years ago

I found different icons in ownCloud repository, but don't know which set is used for panel: https://github.com/owncloud/client/tree/master/theme/white

ikeydoherty commented 8 years ago

With all due respect, that's complete bollocks. Qt apps on Solus integrate with absolutely no issue into the tray, two I can think of off the top of my head are VLC and Mumble. (Qt5+Qt4 builds respectively). When the client is trying multiple courses for the backend... makes me wonder what exactly you're doing in the backend that actually requires these steps

Do you support AppIndicator in qtox? If so that should be priority, given that GTK4 just removed GtkPlug/GtkSocket. Any effort spent on fixing it is going to be sadly useless because we're loosing the x11 tray ...

Or furthering the issue, is there anything weird you're doing that is non standard for an X11 tray icon that I need to force some constraints on ?

zetok commented 8 years ago

Or furthering the issue, is there anything weird you're doing that is non standard for an X11 tray icon that I need to force some constraints on ?

Nothing weird there. As I've indicated before, the problem probably lies in how SVG tray icons are handled.

ikeydoherty commented 8 years ago

Right - and is there some buggery I can do to force the sizing? We pass size hints to clients which are obv. being ignored here