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

tray: allow css styling #245

Merged
merged 3 commits into from
Apr 26, 2024
Merged

tray: allow css styling #245

merged 3 commits into from
Apr 26, 2024

Conversation

trigg
Copy link
Contributor

@trigg trigg commented Apr 21, 2024

tray: add icons to button
tray: fix click logic for button
tray: attach popup menu to button

trigg added 2 commits April 21, 2024 17:50
tray: fix click logic for button
tray: attach popup menu to button
@trigg
Copy link
Contributor Author

trigg commented Apr 21, 2024

Switch the eventbox which is not usable via CSS to a button, and account for the mouse-press differences.

Attach popup corner to icon corner, Gtk accounts for orientation issues automatically

@NamorNiradnug
Copy link
Collaborator

Hi, thanks for your PR!

As far as I remember GtkButton doesn't handle scroll events while EventBox does, and that's the reason EventBox is used currently. Please consider applying some workaround to keep scrolling above tray items working.

@trigg
Copy link
Contributor Author

trigg commented Apr 21, 2024

I can't say I know a single system item that uses scroll wheel, got a program I can test on?

@trigg
Copy link
Contributor Author

trigg commented Apr 21, 2024

From my tests the widget acts the same as before for scroll, but everything I have runs through the GDK_SCROLL_SMOOTH code path... even the discreet scroll wheel.

@soreau
Copy link
Member

soreau commented Apr 21, 2024

From my tests the widget acts the same as before for scroll, but everything I have runs through the GDK_SCROLL_SMOOTH code path... even the discreet scroll wheel.

If you read the documentation, you must first consider the value of the direction field to see if the event is GDK_SCROLL_[CARDINAL] or GDK_SCROLL_SMOOTH. If it is the latter, only then can you use the delta fields.

@trigg
Copy link
Contributor Author

trigg commented Apr 21, 2024

Allow me to rephrase:

All my devices report an ev->direction value of GDK_SCROLL_EVENT.

I am unable to do testing on the alternative codepaths for GDK_SCOLL_* but can't see anything there that would fail when using Gtk::Button in place of Gtk::EventBox.

So:

Each individual 'click' of my mouse wheel calls the signal once with a delta_y of +- 1.5
It takes 4 clicks in a direction before one dbus "Scroll" call is made.

@trigg
Copy link
Contributor Author

trigg commented Apr 21, 2024

With a bunch of std::cout calls plastered about I've come to a conclusion:

On (at least) my version of GTK Every Single scroll event will pose as Smooth scroll until I remove the flag here.

add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);

After this is removed I get GDK_SCROLL_UP and GDK_SCROLL_DOWN on my wheel correctly, and now every 5th click will actually send the signal to the tray program.

So this rules out the previous statement that I couldn't test that code path. I just needed to jump a few more hoops to reach it.

This branch doesn't alter scroll wheel responsiveness on any of my tests.

@ammen99 ammen99 merged commit 0790d5b into WayfireWM:master Apr 26, 2024
2 checks passed
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.

4 participants