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

Add a windows 10 workaround to force dark mode #2216

Merged
merged 9 commits into from May 22, 2021

Conversation

andydotxyz
Copy link
Member

This seems to work well for my machines, looking for more testing

Fixes #2184

Checklist:

  • Tests included. <- this is low level window manager overrides :(
  • Lint and formatter run with no errors.
  • Tests all pass.

This seems to work well for my machines, looking for more testing
@andydotxyz andydotxyz requested a review from Jacalz May 4, 2021 18:11
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if fyne-cross didn't pick up my vendor folder or if it was this code, but I could not see dark title bars. Sorry for a less than optimal test of this.

internal/driver/glfw/window.go Outdated Show resolved Hide resolved
@andydotxyz
Copy link
Member Author

I don't know if fyne-cross didn't pick up my vendor folder or if it was this code, but I could not see dark title bars

I don't know how your vendor is working, but you could try compiling the hello (left in image) or fyne_demo instead?
I also used a replace directive on the terminal project (right in image) to show this working outside the fyne tree...

dark-windows

@andydotxyz
Copy link
Member Author

I realised that it was possible for FYNE_THEME=light to override the OS detected dark theme. This is now fixed and it might fix your test results @Jacalz .

@Jacalz
Copy link
Member

Jacalz commented May 8, 2021

Thanks. I'll have a look. I was changing the theme back and forth using .SetTheme() in my app so that might have been the issue, yes.

@andydotxyz
Copy link
Member Author

Ah, yes the title bar should match OS setting

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with fyne_demo, verified that the vendor correctly had the replace directive for this change, and added a debug print to verify that fyne-cross pricked up the vendor correctly. The bar is till just white even though I have dark theme set in Windows 10.

@andydotxyz
Copy link
Member Author

You marked this as request changes but its not clear what I can change.
Perhaps you can provide reproduction steps or a go mod so that I can replicate the issue?

I am confused about your comment for vendor and fyne_demo, this code is not in the Fyne vendor folder...?

@Jacalz
Copy link
Member

Jacalz commented May 8, 2021

I just marked it as requesting changes because it didn't work. Sorry if I should't have done so.

As for the reproduce, it's not anything special. I just copied fyne_demo to a new folder. Replaced fyne.io/fyne/v2 with this PR (in go.mod) and vendored it so that fyne-cross would use this code for fyne. Then I just ran it on Windows. Not much more to it.

I can't install all the build environments on my Windows machine as it is my school laptop.

@andydotxyz
Copy link
Member Author

Can't you just test fyne_demo in place (fyne-cross windows ./cmd/fyne_demo) rather than going through move/mod/vendor changes?
Trying to eliminate issues here because I cannot replicate it not working.

P.S. marking it changes requested is fine, but I could not progress it so was looking for more info.

@Jacalz
Copy link
Member

Jacalz commented May 8, 2021

I don't think it works to do it that way. Without vendor information, it just creates a new module file in the directory and uses the latest stable release if I remember correctly. I put in a print line in the vendor folder (with -console passed to fyne-cross) to verify that it was being used, and it was.

@andydotxyz
Copy link
Member Author

I am still confused about what this has to do with vendor? cross-compiling the fyne_demo from cmd should use the top level go mod file and all of the code in the currently checked out version..?

@Jacalz
Copy link
Member

Jacalz commented May 15, 2021

Sorry for a late reply. It doesn't quite have anything to do with vendor. I was just bringing it up because I couldn't get this PR to work during testing. Using vendor was just a way to ensure that the contents of this PR got compiled in.

@andydotxyz
Copy link
Member Author

But it would be helpful if you could try fyne_demo or hello so that vendor / module lookup is eliminated from your troubles.

@Jacalz
Copy link
Member

Jacalz commented May 22, 2021

I tried this once more, in the way that you suggest and there is no luck getting it working for me when using fyne_demo. The bar is till white no matter the theme. That it my school laptop though, so it might be a few versions behind on Windows 10. Will give it a try on my Gaming computer to see if there is any more luck there.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This did not initially work on my other computer either, but with an update to the latest major Windows 10 version, it worked flawlessly. Seems to be something odd with the older versions of Windows 10 then, but I would call that Microsoft's fault and not ours 🙂 Nice work 👍

@andydotxyz andydotxyz merged commit ddc2a97 into fyne-io:develop May 22, 2021
@andydotxyz andydotxyz deleted the fix/2184 branch May 22, 2021 14:00
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 this pull request may close these issues.

None yet

2 participants