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

Problems with window.titleBarStyle on Linux systems #10843

Closed
colin-grant-work opened this issue Mar 4, 2022 · 5 comments · Fixed by #10847
Closed

Problems with window.titleBarStyle on Linux systems #10843

colin-grant-work opened this issue Mar 4, 2022 · 5 comments · Fixed by #10847
Labels
bug bugs found in the application shell issues related to the core shell 🤔 needs more info issues that require more info from the author

Comments

@colin-grant-work
Copy link
Contributor

Starting the application on Ubuntu I am getting some odd behavior with my app (no electron top-menu):

image

I get the same problem now, when I try upgrade theia to 1.23.0. from 1.18.0.

After build the electron and start, I got it. No titlebar & top menu, only the content be display.

And I try to set window: Title bar style custom -> native, it will be have a windows tile bar. (other: The restart window look like do not show always.)

So, the window title bar style be default custom in new version, but it can't work in my PC, and then build electron installer running in other PC still so.

And, I try to delete .theia/ in user folder, still so.
And, I try to delete electron/ in AppData folder, still so.

I am using:
node.js: 14.18.1
typescript: 4.5.5

Originally posted by @orange-pig in #10044 (comment)

@colin-grant-work colin-grant-work added bug bugs found in the application shell issues related to the core shell 🤔 needs more info issues that require more info from the author labels Mar 4, 2022
@colin-grant-work
Copy link
Contributor Author

@orange-pig, I have created an issue to track the problem you've encountered, and I'll look into reproducing it

@orange-pig
Copy link

By debug, it look like that because a sync process problem in start, the ElectronMenuContribution.onStart() is not executed, the quetions has happening. But I don't have hard evidence yet, then will to trace it.

@orange-pig
Copy link

orange-pig commented Mar 5, 2022

It turns out my guess above was wrong in the last commit, it's just my debugging phenomenon.

I guess I found the reason of the bug, the real reason is 133 line in the file core/src/eelectron-browser/menu/electron-menu-contribution.ts

130        electron.ipcRenderer.on(TitleBarStyleAtStartup, (_event, style: string) => {
131            this.titleBarStyle = style;
132            this.preferenceService.ready.then(() => {
                      // Note: there is the preference ready, the 'titleBarStyle' value is 'custom'.
                      // I think there need a line with new preference value .
                      //  this.setMenu(app);
133                this.preferenceService.set('window.titleBarStyle', this.titleBarStyle, PreferenceScope.User);
134            });
135        });
136        electron.ipcRenderer.send(RequestTitleBarStyle);
137        this.preferenceService.ready.then(() => {
                  // Note: there is the preference look like default, the 'titleBarStyle' value is 'classic'.
138            this.setMenu(app);
139            electronRemote.getCurrentWindow().setMenuBarVisibility(['classic','visible'].includes(this.preferenceService.get('window.menuBarVisibility', 'classic')));
140        });

@msujew
Copy link
Member

msujew commented Mar 5, 2022

@orange-pig Thanks for tracking this down. I created a fix for this in #10847, do you mind trying it out?

@orange-pig
Copy link

@msujew Good, It works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application shell issues related to the core shell 🤔 needs more info issues that require more info from the author
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants