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

Darktable window cannot be resized (DT 3.0, Windows 10) #3307

Closed
sotsoguk opened this issue Nov 6, 2019 · 20 comments · Fixed by #3315
Closed

Darktable window cannot be resized (DT 3.0, Windows 10) #3307

sotsoguk opened this issue Nov 6, 2019 · 20 comments · Fixed by #3315

Comments

@sotsoguk
Copy link

sotsoguk commented Nov 6, 2019

Describe the bug

After installing the RC of Darktable 3.0 on Windows 10, i cannot resize the main application window. Fullscreen Toggle works, and on the top border of the winow at some locations the height can be changed. On the left, right and lower border resize does not work, i.e. the mouse cursor does not change to indicate a resizable window.

To Reproduce
Steps to reproduce the behavior:

  1. Install the Darktable 3.0 RC on Windows 10
  2. Start
  3. Try to resize Window

Expected behavior
The Main window should be resizable

Platform (please complete the following information):

  • OS: Windows 10 Pro
  • Version 1909 (Build 18363.418)

Additional context
I have two monitors, one 4K at 125% Scaling and one WQHD at 100%. I changed to only one Display at 100% but nothing changed.
Already have done a fresh install with all config files of old versions deleted.

@sotsoguk sotsoguk changed the title Window cannot be resized (DT 3.0, Windows 10) Darktable window cannot be resized (DT 3.0, Windows 10) Nov 6, 2019
@peterbud
Copy link
Contributor

peterbud commented Nov 6, 2019

Confirmed - I have the same issue
I even have a first hunch: https://github.com/darktable-org/darktable/blob/master/src/gui/gtk.c#L1028
Returning TRUE in the window-state-change event stops propagation of the event. Once we return FALSE, the maximize and minimize button start working. However users are still not able to resize the window. Maybe it has something to do with some setting in thte CSS theme?

@sotsoguk
Copy link
Author

sotsoguk commented Nov 6, 2019

I am looking through the css, but i don't know any gtk stuff ...

@Nilvus
Copy link
Contributor

Nilvus commented Nov 6, 2019

Confirmed - I have the same issue
I even have a first hunch: https://github.com/darktable-org/darktable/blob/master/src/gui/gtk.c#L1028
Returning TRUE in the window-state-change event stops propagation of the event. Once we return FALSE, the maximize and minimize button start working. However users are still not able to resize the window. Maybe it has something to do with some setting in thte CSS theme?

I have worked on grey theme so I have see the whole CSS. In CSS, nothing is related to window size and this problem seems to affect only Windows. Depending on screen size, panels size could have impact (only limits on reducing window though). So I really don't think it could be related to CSS. Could be more probably about Gtk/Cairo code related to GTK Windows port.

@peterbud
Copy link
Contributor

peterbud commented Nov 6, 2019

This is a CSS issue IMHO. I can fix this by changing the CSS padding from 0 to 1:

*
{
  background-color: @bg_color;
  background-image: none;
...
  padding: 1;
...
}

After changing this and restarting darktable, I can resize the main window.

Could somebody pls test it?

@Nilvus
Copy link
Contributor

Nilvus commented Nov 6, 2019

This is a CSS issue IMHO. I can fix this by changing the CSS padding from 0 to 1:

*
{
  background-color: @bg_color;
  background-image: none;
...
  padding: 1;
...
}

After changing this and restarting darktable, I can resize the main window.

Could somebody pls test it?

Anyway, that doesn't mean it's a CSS issue. It's just mean it's a workaround to the Windows related bug. This issue doesn't affect Linux for example and adding padding here mean that all elements on the UI have now a padding of 1. Not wanted !

Waiting to find the real issue behind that wrong behaviour, have you test adding padding here (instead of all elements as you have test) :

#outer-border
{
background-color: @border_color;
min-width: 20px;
padding: 1px;
}

If the workaround work here, adding a 1px padding only on outer borders will be better than an all items.

@TurboGit
Copy link
Member

TurboGit commented Nov 6, 2019

I agree with Nilvus, if adding padding make the Window resizable it means that dt on Windows seems to be lacking some border around (could explain why one cannot grab the border of the application to resize it).

So maybe we can fix that in the code when creating main Window? Or have the 1px border as proposed by Nilvius.

@TurboGit
Copy link
Member

TurboGit commented Nov 6, 2019

To be clear, I mean in the C code as there we can add the 1px on the border only for Windows OS and not touch the other ports.

@parafin
Copy link
Member

parafin commented Nov 6, 2019

Usually windows borders are drawn by window manager, application can just set some hints whether borders should be present at all. Is it different on Windows?

@MStraeten
Copy link
Collaborator

I can reproduce it too, but some weeks ago everything was fine in the dev-version. Unfortunately i‘m not able to reconstruct when the behaviour changed - after an update of my msys environment or a specific commit

@phrrk
Copy link
Contributor

phrrk commented Nov 6, 2019

I don't have this issue with 3.0.0RC0+22 and windows 7 (msys has not been updated for about a month)

@mbaumgae
Copy link
Contributor

mbaumgae commented Nov 6, 2019

I can reproduce this issue with a newly recompiled 2.7.0+1395~ge6a3b3505 on Windows 10 with updated msys environment. Must be related to a new package. Not yet clear which updated package leads to this issue.

@sotsoguk
Copy link
Author

sotsoguk commented Nov 7, 2019

Waiting to find the real issue behind that wrong behaviour, have you test adding padding here (instead of all elements as you have test) :

#outer-border
{
background-color: @border_color;
min-width: 20px;
padding: 1px;
}

If the workaround work here, adding a 1px padding only on outer borders will be better than an all items.

If i change padding: 0; to padding: 1; in the * section of darktable.css the windows are resizable. Its very hard to grab the window as the area is small, and it seems to be not exactly at the edge but a little bit off.

Changing only at #outer-border does not work for me. Thx

@peterbud
Copy link
Contributor

peterbud commented Nov 7, 2019

I'm also not satisfied with changing the CSS, to be honest.

With additional research it seems that the GTK3 package we have in MSYS2 has been changed early October (see the dropped CSD patch and the original bug), and that results that CSD is forced now for the GTK apps by default, and that might be the reason of this change in behavior.

If you set the environment variable GTK_CSD=0 and launch darktable with the original CSS, window resize works again.

I'm trying to discuss with MSYS folks what is the best approach here, however if you have ideas pls share.

@parafin
Copy link
Member

parafin commented Nov 7, 2019

Just push GTK_CSD=0 to environment before calling gtk_init.

@sotsoguk
Copy link
Author

sotsoguk commented Nov 7, 2019

I'm also not satisfied with changing the CSS, to be honest.

With additional research it seems that the GTK3 package we have in MSYS2 has been changed early October (see the dropped CSD patch and the original bug), and that results that CSD is forced now for the GTK apps by default, and that might be the reason of this change in behavior.

If you set the environment variable GTK_CSD=0 and launch darktable with the original CSS, window resize works again.

I'm trying to discuss with MSYS folks what is the best approach here, however if you have ideas pls share.

Thx, this is working for me as well

@phrrk
Copy link
Contributor

phrrk commented Nov 7, 2019

It looks like the MSYS folks are looking at putting the CSD patch back in the GTK3 package.

@parafin
Copy link
Member

parafin commented Nov 7, 2019

I would suggest not to rely on that. They can remove it again later.

@peterbud
Copy link
Contributor

peterbud commented Nov 7, 2019

It looks like the MSYS folks are looking at putting the CSD patch back in the GTK3 package.

I have talked with them :)

@chhil
Copy link

chhil commented Nov 7, 2019

For some of us that simply follow instructions in the build txt file for windows, please do share with us what would need an update in msys and how would we go about doing it when its ready.

@mbaumgae
Copy link
Contributor

mbaumgae commented Nov 7, 2019

The command "$pacman -Syu" updates the installed package and core system packages of msys to the most recent released versions.
Building and installing darktable as described in build.txt after the update, uses then the updated packages.

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

Successfully merging a pull request may close this issue.

9 participants