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

App.toggleWindow removes focus from Button widget after the second click #278

Closed
KisNJ opened this issue Jan 29, 2024 · 5 comments
Closed

Comments

@KisNJ
Copy link

KisNJ commented Jan 29, 2024

When I press the button for the first time the Calendar opens correctly, after another press it closes correctly, but before the third press to open the Calendar again, I have to move my mouse to get the button focused again.

If I change App.toggleWindow to print("Something") then the button works correctly.

2024-01-29.20-11-31.mov
// The Button
const yearMonthDay = Widget.Button({
  on_clicked: () => App.toggleWindow('Calendar')
  child: Widget.Label().hook(datePolled, self => {
          self.label = datePolled.value.yearMonthDay
     })
})

// The variable 
const datePolled = Variable({yearMonthDay: '', hourMinute: ''}, {
    poll: [30000, "date +'%Y.%m.%d|%H:%M'", date => { 
        const [yearMonthDay, hourMinute] = date.split('|')
        return {yearMonthDay, hourMinute}
    }]
})
@Aylur
Copy link
Owner

Aylur commented Jan 29, 2024

I'm guessing you are using Hyprland because it was a Hyprland issue that was fixed not too long ago

@Aylur Aylur transferred this issue from Aylur/dotfiles Jan 29, 2024
@KisNJ
Copy link
Author

KisNJ commented Jan 29, 2024

Thanks, then I'll wait for the update.
Currently I have the Calendar inside a Window which has the margins property set so it's under the year, is there a better way that doesn't depend on hardcoded values, and still places the Calendar under the year?

@Aylur
Copy link
Owner

Aylur commented Jan 29, 2024

A Gtk.Popover, but its currently broken on gtk3 if its not inside a window itself, so no

@KisNJ KisNJ closed this as completed Jan 30, 2024
@Freemason-12
Copy link

I'm guessing you are using Hyprland because it was a Hyprland issue that was fixed not too long ago

Can you please link to that issue? I'm using Hyprland 0.38.0 and I have the same issue as well

@Freemason-12
Copy link

If that issue seemingly fixes it (and I still have it) maybe that's an ags issue then, isn't it?

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

No branches or pull requests

3 participants