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

Embed window controls ( - + x ) / traffic lights in the app when running on Linux #23665

Open
3 tasks done
rathboma opened this issue May 19, 2020 · 6 comments · May be fixed by #41769
Open
3 tasks done

Embed window controls ( - + x ) / traffic lights in the app when running on Linux #23665

rathboma opened this issue May 19, 2020 · 6 comments · May be fixed by #41769

Comments

@rathboma
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

Breaking out from #11907 currently there is no way on Linux to embed the native window controls (traffic lights) inside the Electron app.

This currently works great on MacOS, and allows us to implement our own good-looking (if not entirely native) titlebar UI, or omit it entirely.

Mac screenshot:
Screen Shot 2020-05-19 at 10 41 00 AM

Proposed Solution

  • A config setting to allow Traffic lights ( - + x ) to be embedded.
  • Some sort of property to tell the app where on the app the traffic lights are (left, middle, right), and the horizontal size

Alternatives Considered

See #11907 for a list of alternatives

@alice-mkh
Copy link

This is kinda difficult, but doable: you would have to look at GtkHeaderbar's window button implementation and basically copy that.

In GTK4 there's a widget for this specifically, alled GtkWindowControls, that you could overlay about your view though.

Also don't forget the controls can be on either side of the window, incl. both at once.

@rathboma
Copy link
Author

If this is easily doable using GTK4 I think that's a great path forward. For any DE supporting GTK4 it could allow this feature.

@alice-mkh
Copy link

it's not DE that should support GTK4, it's Electron. A window is a window regardless of what toolkit it uses to draw it. However, GTK4 is not released yet. :p

@rathboma
Copy link
Author

Yep yep I know we're only on 3.38 :-), but it's nice to have a forward looking idea if possible!

@alice-mkh
Copy link

3.38? Umm, 3.24... But ok.

@alice-mkh
Copy link

Just forgot, another thing you will need in this case is to mask away window corners (the only reason headerbars have them is because they are not in the main window and so there's no content there, and bottom corners are impossible). I hope to get that into GTK4, but if you go with GTK3, there's a widget for that in libhandy (HdyWindow)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants