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

Unlock dialogue misdrawn when UI scaling in "Double (Hi DPI)" mode #55

Closed
ch3pjw opened this issue Jun 8, 2014 · 31 comments
Closed

Unlock dialogue misdrawn when UI scaling in "Double (Hi DPI)" mode #55

ch3pjw opened this issue Jun 8, 2014 · 31 comments

Comments

@ch3pjw
Copy link

ch3pjw commented Jun 8, 2014

Mint 17 64 bit,
Cinnamon 2.2.13
3.13.0-24-generic Linux kernel

I have manually set my screen UI scaling to "Double (Hi DPI)" mode on my X1Carbon, which appears to cause the unlock dialogue to be drawn badly. I can't figure how I'd get a screen dump of the issue, so I shall attempt to describe below. This issue doesn't happen with regular scaling, or auto, which I think is erroneously using regular as well.

After locking the screen, and moving the mouse or whatever to initiate the unlock dialogue to appear, normally one gets something that looks like this:

+--------------------------------+
| +---+  User name               |
| +---+  Host info               |
| Password: [__________________] |
| <switch user>   <unlock>       |
+--------------------------------+

What you get instead on high DPI is this:

+-----------------+--------------+
| +---+  User name|              |
| +---+  Host info|              |
| Password: [_____|              |
| <sw usr><unlock>|              |
+-----------------+              |
|                                |
|                                |
|                                |
|                                |
|                                |
+--------------------------------+

Where the large blank area is shaded in the same grey as the normal window background. The layout of the actual buttons looks kinda cluttered and the password field looks like it's been cut off. I would have expected exactly the same UI layout with my scaling factor applied, which is working on the desktop itself.

Everything works as expected, it just looks a little rough!

@otto-unnormalverbraucher

Joining in! I am using
Mint 17 64 bit,
Cinnamon 2.2.16
3.13.0-24-generic kernel
I can provide a screenshot.
BTW language is irrelevant. Also appears in english version.
bildschirmfoto vom 2014-08-20 09-24-05

@mishan
Copy link

mishan commented Nov 12, 2014

Ditto.

@digi691
Copy link

digi691 commented Jan 31, 2015

Issue still persist on my X1 Carbon Gen3 with a resolution of 2560 x 1440. Seems like this has been open for a wihle. Is there just not a dev with a HiDPI Screen? I'm willing to test a branch with modificaitons or if someone could point me into the right direction I may be able to correct myself and issue a PR.

Arch Linux
Cinnamon 2.4.6
Kernel 3.18.4-1

@jakelogemann
Copy link

Still waiting on a fix for this.

@mtwebster
Copy link
Member

Hi, this commit: bfb41fb was intended to fix a black strip we were seeing in the background of the screensaver... oddly though, I've not gotten a 'double' dialog since then either (although in hidpi, the dialog is still twice as tall as it should be)

A couple of us have hidpi screens to test things on (there would be no hidpi support otherwise) - however, it's a matter of priorities, and this really hasn't been one unfortunately.

@EAnushan
Copy link

Confirmed. X1 Carbon 3rd Gen, 2560 x 1440 screen using Double (HiDPI) mode. Lock screen is the same as in screenshots above.

@AlexanderVatov
Copy link

Confirmed. 2013 MacBook Pro with 13" Retina, 2560 x 1600 screen. Lock screen appears as in the screenshot.

@dhoffend
Copy link

dhoffend commented Jul 9, 2015

Confirmed with Mint 17.2 still :-(

@InAnimaTe
Copy link

^Exactly. X1 Carbon, Linux Mint 17.2

@clidx
Copy link

clidx commented Sep 17, 2015

Can confirm this.

At the very least could there be an setting to disable the lockscreen and go straight to the display manager?

@arjunyg
Copy link

arjunyg commented Sep 24, 2015

So over a year later...is there any update?

@oraerk
Copy link

oraerk commented Sep 30, 2015

The bug is still there

@yorickpeterse
Copy link

Same problem when using an X1 Carbon 3rd generation.

@gerow
Copy link

gerow commented Nov 26, 2015

Just copying this from the dupe bug. Seeing this happen in a slightly different way, but I wouldn't be surprised if it's the same underlying issue.

Different case

@pietsch
Copy link

pietsch commented Nov 30, 2015

This bug still affects users with HiDPI Lenovo X1 Carbon laptops running a current Debian testing with Cinnamon 2.6.13. It looks just like the screenshot provided by otto-unnormalverbraucher on 21 Aug 2014. Which is a pity because otherwise Cinnamon supports HiDPI out of the box way better than Gnome, KDE or XFCE.

@andrewbowden
Copy link

This happens on a MacBook Pro 13 Retina too, running on Cinnamon on top of Ubuntu 15.10.

Shame the bug is still there - Cinnamon's HiDPI support otherwise is absolutely excellent.

@marga-google
Copy link

It's very easy to reproduce this bug without any specific piece of hardware. Just turn the interface scaling to Double when the screen is not big enough and you'll get the deformed window.

I tinkered a bit with the code related to this, but was not able to make much progress. I suspect the problem is in one of the GTK widgets that the screensaver uses.

@anibyl
Copy link

anibyl commented Mar 24, 2016

+1
After screen lock it looks good. Once I enter incorrect password bug reproduces.
Mint 17.3, Cinnamon 2.8.6.

@mmatviyiv
Copy link

The same issue. Any progress with fixing it?

@rlgomes
Copy link

rlgomes commented May 21, 2016

I decided to hack a quick solution that met my needs by simply fiddling a bit with the grid layout this did the job:

diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 56f5055..3121862 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -2514,8 +2514,8 @@ gs_window_init (GSWindow *window)
         update_clock (window);

         gtk_misc_set_padding (GTK_MISC (window->priv->clock), 4, 4);
-        gtk_grid_attach(GTK_GRID(grid), window->priv->clock, 0, 1, 1, 1);   
-        gtk_grid_attach(GTK_GRID(grid), window->priv->vbox, 1, 1, 1, 1);        
+        gtk_grid_attach(GTK_GRID(grid), window->priv->clock, 1, 0, 2, 1);   
+        gtk_grid_attach(GTK_GRID(grid), window->priv->vbox, 1, 1, 2, 1);        
         GtkWidget * right_label = gtk_label_new(NULL);        
         gtk_widget_show (right_label);
         gtk_grid_attach(GTK_GRID(grid), right_label, 2, 1, 1, 1); 

Not the prettiest but at least you can clearly read and access the elements on the lock screen, here's what it looks like for me now:

005

I wanted to make the box containing the input field and buttons a little less tall but for now this is a huge improvement.

@EiNSTeiN-
Copy link

This is happening on my Surface Book as well

@EiNSTeiN-
Copy link

Here are step by step instructions I noted for myself in order to apply @rlgomes's workaround on Ubuntu:

Make sure the universe source is not commented in your /etc/apt/sources.list:

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe

Get the source for your version of cinnamon-screensaver

apt source cinnamon-screensaver

This will download the source into a folder named cinnamon-screensaver-2.8.0 (the version may be different).

At this point apply @rlgomes's patch from #55 (comment) and then build the source:

cd cinnamon-screensaver-2.8.0
fakeroot make -f debian/rules clean build binary

This will create the file cinnamon-screensaver_2.8.0-1_amd64.deb in the parent directory which you can then install:

sudo dpkg -i ../cinnamon-screensaver_2.8.0-1_amd64.deb

@marga-google
Copy link

I spent some time looking into this today, trying to find a solution that would fit the needs of those that use the double resolution and those that use the normal resolution. Unfortunately, after several hours of trying different things, I wasn't able to achieve something that looked good on both.

One of the conditions that leads to this is that the layout of the screensaver lock is so that 1/3 is used for the clock, 1/3 for the lock prompt and 1/3 is left empty. The problem appears when the total available space in each of those thirds is reduced to less than what is necessary for the password prompt, which is requesting a minimum of 450 pixels (in gs-lock-plug.c). Which means that a minimum of 1350 pixels (plus borders) is needed, which is not the case for the X1 carbon with 2560/2=1280.

I was testing with even less pixels (double resolution on a 1920x1080 screen) so I had to turn those 450 into 300, and then it worked fine for the double, but of course it looks rather small for the normal configuration.

i don't fully understand why there's a second larger box behind the other one. After fiddling with some things I got it to display both frames with the buttons in it (as in the screenshot that gerow pasted above). And if I remove the homogeneous constraint from the grid, one of the two frames is exactly double the dimensions of the other (i.e. double height and double width). Given that in some cases I only got the big one and in some cases both, it looks like there's some weird race where the same widget is getting drawn once without touching the dimensions and once with doubling the dimensions, which shouldn't be done because the dimensions had already been doubled.

The solution proposed by @rlgomes includes putting the clock on top of the prompt instead of on the left. Given the constraints I think this might be a possibility to consider, but a proper solution would be to a) no have the prompt be drawn with double dimensions, b) cap the width of the prompt depending on the size of the screen.

@mtwebster
Copy link
Member

Don't want anyone to think this is being ignored - this has been hacked at for a long time now. I think the fundamental problem is that GtkPlug/Socket (a way to embed widgets from one process into another) was never given hidpi support - it does not work at all under Wayland. Here is the upsteam bug (as well as a patch that has not been accepted at this point): https://bugzilla.gnome.org/show_bug.cgi?id=765327

We could definitely rewrite this to not use GtkPlug/Socket - there are a lot more convenient ways to handle authenticating the current user than this currently uses. There is also a lot of cruft dealing with use-cases that just don't occur anymore, that could just go away. It's just not trivial, and we're considering if we have to rewrite too much, we might just start from scratch with something more maintainable.

@rlgomes
Copy link

rlgomes commented May 25, 2016

Thanks for the update @mtwebster I just wanted to put up a patch that others could use to at least make the current lock screen usable. I just recently got a laptop with the hidpi display and outside of the lock screen everything else seems to work very well so you guys have done a great job everywhere else in cinnamon!

@JosephMcc
Copy link
Contributor

Should be fixed by 6ac60f4

@rlgomes
Copy link

rlgomes commented May 31, 2016

@JosephMcc @mtwebster fix works perfectly, thanks guys!

@JosephMcc
Copy link
Contributor

JosephMcc commented May 31, 2016

Thanks but to be fair @mtwebster did all the work.

@marga-google
Copy link

Thanks @mtwebster !

@otto-unnormalverbraucher

+1 Thank You @mtwebster

@EiNSTeiN-
Copy link

Works well, thanks a lot @mtwebster!

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

No branches or pull requests