-
Notifications
You must be signed in to change notification settings - Fork 37
Ported to GTK4 #290
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
base: master
Are you sure you want to change the base?
Ported to GTK4 #290
Conversation
Update from upstream
- - Almost everything is broken. - - This is expected
- - This is insane. - - No, how is this even usable - - Well whatever. - - Someone please valgrind because I'm sure there's lots of bad ideas here.
- Some changes to SNI dbusmenu - Getting occassional segfaults in SNI dbusmenu so these need a better read-through before calling it
- - Still inherently broken until dbusmenu-glib reports a type back
- Dock takes entire width but sets itself to click-through on the outside - Switched panel to using CenterBox which does a better job than my implementation - Moved CSS dir loading into base app class
- First attempt at output changes
- Output hot plugging sorted. - - This will need testing by people with more than 1 external monitor to see if there's any unknowns.
- Add an option to animate icons removed from dock - Added to default dock CSS
- Fixed rectangle hints in dock and panel - Fixed volume scrolling
- Fixed changing fill type in background triggering a new image load - Remove GTK interactive debugging
Swap the x texture coordinates because the images were reversed.
background: Rewrite to use GL instead of cairo for rendering
Before, we were uploading a texture twice: once when it's picked and once after it switches to fade out. This makes it so the old texture id is reused when fading to a new image, and avoids a call to glTexImage2D.
background: Optimize texture uploading by only calling glTexImage2D once
window-list: Set minimize target more reliably
window-list: Set minimize target even more reliably
Hi and thanks for the big PR, very nice to see the update! I am going through the code to familiarize myself with whatever changes you have made, in the meantime I tried to copy the default CSS files and to compare the old and the new wf-panel. There are some very annoying differences which I am not sure how to solve, maybe they depend on the theme? Here is a screenshot, above is current master, below is this branch: Most notably: backgrounds for menu, command and clock seem to not be unset, and there is a dark/black background behind the launchers instead of semi-transparent. Ditto for the ethernet connection. Icons also appear quite different. |
I am also getting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked over the changes, really good work :) My focus was the structure, haven't looked at every single UI call in detail but I assume we will find bugs like that during testing. A few things that I noticed or questions that I have.
@@ -7,3 +7,6 @@ | |||
[submodule "subprojects/wayland-logout"] | |||
path = subprojects/wayland-logout | |||
url = https://github.com/soreau/wayland-logout | |||
[submodule "subprojects/gtk4-layer-shell"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we remove the gtk-layer-shell submodule (which is for gtk3)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I've missed something, that is GTK4, not 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this is the good one, but the 3 version is also there in the gitmodules (unless I am mistaken)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it is, but .git/config
had the right of it, and it seemed to be ignoring .gitmodules
. Strange, but okay.
src/panel/panel.cpp
Outdated
* the lifetime of the output */ | ||
return true; | ||
// window->signal_close_request().connect( | ||
// sigc::mem_fun(*this, &WayfirePanel::impl::on_delete)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is not needed anymore we cna just delete the code, no need to leave it commented :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a running bad habit of mine. Sorry!
src/panel/panel.cpp
Outdated
@@ -315,6 +291,24 @@ class WayfirePanel::impl | |||
public: | |||
impl(WayfireOutput *output) : output(output) | |||
{ | |||
// Intentionally leaking feels bad. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether these shouldn't be static variables. We don't need one instance per output, right? This creates new objects every time we plug an output, but if they were static variables, they would be initialized just once for all outputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved them up into the App class, during on_activate. This is a much better position for them
src/panel/panel.cpp
Outdated
// So on | ||
new CssFromConfigFont("panel/battery_font", ".battery {", "}"); | ||
new CssFromConfigFont("panel/clock_font", ".clock {", "}"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1000 for the idea to translate .ini to css, I really like the solution :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed like the thing to do at the time.
I've had to re-write the font handling as it was broken again, and it hadn't been handling people using fonts like NotoSans 10
to assume 10pt
. It now assumes pt
if no unit is given from px
rem
or em
return result; | ||
} | ||
|
||
void WayfireWindowListBox::forall_vfunc(gboolean value, GtkCallback callback, gpointer callback_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of this code was to ensure that we can drag and drop toplevels in the list to rearrange them. I assume that custom drawing is no longer as simple as this code implements it?
If so, could we make use of gtk drag and drop to rearrange toplevels, potentially showing a drag icon? Currently, drag and drop does rearrange the toplevels but there is no animation and no indication of what is going on, which I personally find a bit confusing.
In addition, at the end of the drag and drop, the dragged view gets a special status (probably 'active drag and drop') and remains like that, so we have to unset somethinig probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretically, we could subclass a LayoutManager, and write our own logic on size and location of children.
In reality I can't make it compile when I try.
- Removed some commented code
- Fixed font config...
Extensive changes to bring the code base up to working on GTK4.
Dependencies:
Material changes overview:
icon_size
options have been fed into CSS Styles that are generated & updated from config17px
1.2em
0.9rem
While I was in the area:
I'm sure there's more, and will edit this as and when possible.
I look forward to uncrustify.