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

Calendar widget sometimes doesn't hide #379

Closed
unode opened this issue Jan 5, 2018 · 9 comments
Closed

Calendar widget sometimes doesn't hide #379

unode opened this issue Jan 5, 2018 · 9 comments
Milestone

Comments

@unode
Copy link
Contributor

unode commented Jan 5, 2018

I have a dual monitor setup. The second monitor is setup above the primary.

All screens have their own widget bar at the top of each monitor and are configured using:

awful.screen.connect_for_each_screen(function(s)
...

When moving the mouse cursor from one screen to the next (usually bottom to top) over the calendar widget, the floating calendar sometimes remains visible as if the widget was still being hovered.
When this happens, the floating calendar will only vanish if I either click on the floating window or if the mouse hovers one of the two textclock widgets (one on each monitor).
With other widgets (e.g. fs) something similar happens but the floating window vanishes as soon as any widget is hovered or when the mouse moves to a different screen.

I generally initialize widgets with this kind of code pattern:

local fsicon = wibox.widget.imagebox(theme.widget_hdd)
local fswidget = lain.widget.fs({
    followtag = true,
    ...
})

awful.screen.connect_for_each_screen(function(s)
    s.mywibox:setup {
        ...
        {
            layout = wibox.layout.fixed.horizontal,
            fsicon, fswidget.widget,
        ...

With calendar I have to use attach_to:

local mytextclock = wibox.widget.textclock("%a %d/%m/%Y, %H:%M", 10)

lain.widget.calendar({
    attach_to = { mytextclock },
    followtag = true,
    ...
})

because the factory function of calendar doesn't return anything.

The wiki incorrectly mentions:

local calendar = lain.widget.calendar()

In this case, calendar is nil.

Given the above, is there any chance that calendar's factory is modified to behave the same as other widgets? I suspect this alone might be sufficient to address the sticky issues I'm experiencing.

While the 'not hiding' behavior might be an issue with awesome, the fact that the calendar behaves differently from other widgets might be explained by the use of attach_to.

@lcpz lcpz added this to the release 1.0 milestone Feb 16, 2018
lcpz added a commit that referenced this issue Sep 6, 2018
@lcpz
Copy link
Owner

lcpz commented Sep 6, 2018

the fact that the calendar behaves differently from other widgets might be explained by the use of attach_to

Indeed: in order to make it behave like other widgets, we have to somehow duplicate wibox.widget.textclock, which is not desirable.

Also, note that awful.widget.calendar_popup is built in the same way.

I've fixed the wiki. Do you still experience this issue?

@unode
Copy link
Contributor Author

unode commented Sep 6, 2018

Do you still experience this issue?

Yes, quite frequently.
Wouldn't say every time I move the mouse to a different screen but often enough to be annoying.

It seems to happen more often when the multi-screen setup is above or below. If on left/right it doesn't happen so often. Probably due to the fact the with left/right awesome still sees the unhover before the mouse leaves the screen.

@lcpz
Copy link
Owner

lcpz commented Sep 6, 2018

I can either make calendar an object to be returned by the factory method as you suggested, thus changing the current API, or assert that calendar notifications are not displayed on unfocused screens. I don't see how the first option would solve it though.

But before deciding, please check if this happens on a single screen setup too.

@unode
Copy link
Contributor Author

unode commented Sep 7, 2018

Just tried it. It doesn't happen easily but a few minutes of moving the mouse quickly on and off the widget made it happen twice.

@lcpz
Copy link
Owner

lcpz commented Sep 12, 2018

I did both things from #379 (comment) in two commits in a separate branch.

Please do git checkout cal and test ab3ac49 and 4c013d4 separately.

@lcpz
Copy link
Owner

lcpz commented Sep 12, 2018

I double checked and noticed that both won't solve the issue.

I'm working on a new implementation. I will push updates shortly.

@lcpz
Copy link
Owner

lcpz commented Sep 14, 2018

@unode New implementation is up. Please check newcal branch and tell me what do you think.

EDIT: Personal reminder: this removes cal as dependency. Create a watcher to be put into recipes. Add the option for displaying 3 months spanning the date. And, update the wiki, including also info for #320.

@lcpz
Copy link
Owner

lcpz commented Sep 14, 2018

Add the option for displaying 3 months spanning the date.

Done. I'm going to merge with master in a couple of days. Merged now.

Read the wiki to update your configuration.

@lcpz lcpz closed this as completed Sep 14, 2018
@unode
Copy link
Contributor Author

unode commented Sep 17, 2018

Just tested and haven't hit any problem so far. Thanks for the update.

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

2 participants