mate-desktop / mate-panel

MATE panel
https://mate-desktop.org
GNU General Public License v2.0
185 stars 118 forks source link

mate-panel not hided automatically if we clic on an icon #620

Open aaaaadrien opened 7 years ago

aaaaadrien commented 7 years ago

I use a mate-panel at the bottom of my screen. I enabled the option which hide automatically the panel. I added on this panel some icons (launchers) of programs that I use the most. When the bar is hided, if i put my mouse in the bottom of my screen, the panel is showing, and if i remove my mouse, it hides. But If i put my mouse in the bottom of my screen, i click on a launcher to start an application, and i remove my mouse of the panel, the panel doesn't hide.

Expected behaviour

Actual behaviour

Steps to reproduce the behaviour

MATE general version

1.18

Package version

1.18.2

Linux Distribution

Gentoo

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/47287100-mate-panel-not-hided-automatically-if-we-clic-on-an-icon?utm_campaign=plugin&utm_content=tracker%2F314880&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F314880&utm_medium=issues&utm_source=github).
vfscanf commented 6 years ago

I experience this bug as well and have found the problem. In mate-panel/panel-toplevel.c (Line 3822) is the following code:

if (!toplevel->priv->auto_hide || panel_toplevel_contains_pointer (toplevel) || panel_toplevel_get_autohide_disabled (toplevel)) return;

Inside the panel_toplevel_queue_auto_hide it checks if the mouse pointer is really outside the panel. This works most of the time, however if you move the mouse quickly the mouse coordinates reported lag behind and the check fails. Removing the panel_toplevel_contains_pointer (toplevel) check fixes the problem, but I'm not sure if it breaks some other part of the code. I'm willing to produce a Pull request but I would like to get feedback from one of the developers first.

meequz commented 6 years ago

Came here to report the same issue. I have even recorded a video panel-hide-bug.ogv.zip

vfscanf commented 6 years ago

I've made a pull request with my little fix. You can build and test it. I've already used it for a few days and didn't detect any issues. Feedback is welcome.

raveit65 commented 6 years ago

Hmm, i tried to reproduce the issue with fedora 26 and MATE-1.19 dev version, but i don't see the issue here with top or bottom panel. After i started an application with a launcher the panel hides. I followed steps to reproduce, did i miss something?

vfscanf commented 6 years ago

You have to setup an autohide panel with only application launchers on it. Then click on an application launcher and move your mouse quickly outside the panel (while the application is starting). If you leave the mouse on the panel while the application is starting it doesn't work.

I will install Fedora 26 later and try to reproduce the issue there.

raveit65 commented 6 years ago

Can you try f27 which use Mate 1.19? Normal f26 use 1.18.

vfscanf commented 6 years ago

Yes, I'll try Fedora 27.

raveit65 commented 6 years ago

wtf, using auto-hide does not work in qemu VM -_- I mean panel hides but i don't have a 1 pixel area to bring them back. I lost panel until 'mate-panel --reset --replace' I hate to hack my real system on bare metal .

meequz commented 6 years ago

If you leave the mouse on the panel while the application is starting it doesn't work.

I suspect it's because the icon animation covers the panel right after the click, so the cursor-goes-away action is not triggered.

raveit65 commented 6 years ago

If you leave the mouse on the panel while the application is starting it doesn't work.

Ok, this i can reproduce. But why should the panel goes a way if i leave the mouse over the panel launcher? I mean if i move the mouse to desktop than the panel hides. What is wrong with that behaviour?

meequz commented 6 years ago

@raveit65 please see my video posted above. Usually I want to panel hide after I click on some icon on it. I don't need to see the panel after click.

raveit65 commented 6 years ago

@meequz See my video how it works here https://www.dropbox.com/s/dtggkwgieclws3b/panel-hide.ogv.tar.xz?dl=0

raveit65 commented 6 years ago

Same behaviour if i use a third panel only with launchers.

raveit65 commented 6 years ago

Sorry, i don't have ubuntu installed on bare metal. @flexiondotorg Can you reproduce the issue with ubuntu?

vfscanf commented 6 years ago

Ok, this i can reproduce. But why should the panel goes a way if i leave the mouse over the panel launcher? I mean if i move the mouse to desktop than the panel hides. What is wrong with that behaviour?

It shouldn't. Bad wording on my part. The only problem is that the panel doesn't go away if you move the mouse away too quickly.

vfscanf commented 6 years ago

I suspect it's because the icon animation covers the panel right after the click, so the cursor-goes-away action is not triggered.

Yes the leave event should hide the panel as well. As you say it isn't triggered.I found that out by placing some g_message() calls inside the event handlers.

meequz commented 6 years ago

@raveit65

See my video how it works here

You were waiting. Move the cursor to the opening window right after the click. Don't wait.

raveit65 commented 6 years ago

You were waiting. Move the cursor to the opening window right after the click. Don't wait.

Got it. it's reproducible in this way.....

monsta commented 6 years ago

@aaaaadrien: please try the fix from https://github.com/mate-desktop/mate-panel/pull/685.

monsta commented 6 years ago

Ok, the fix works and is merged now.

raveit65 commented 6 years ago

commit is revered as i causes a regression. https://github.com/mate-desktop/mate-panel/issues/773

vfscanf commented 6 years ago

I would like to have a look at what caused this regression. Do you have a distribution / setup for me where I can reproduce this problem (see #773 for distributions I've already tried)?

raveit65 commented 6 years ago

An updated f27 with 1.20 and mate-panel < = 1.20.1-2

monsta commented 6 years ago

@vfscanf: in some cases you might need to move the mouse after opening the menu. The panel will then autohide after you move the pointer off it, somewhere over some menu items. Maybe it will help to reproduce it.

vfscanf commented 6 years ago

OK, now I was able to reproduce the bug and I did some investigation. When you open a menu we actually get a leave notify event from Gtk, which in turn calls panel_toplevel_queue_auto_hide(). The panel_toplevel_contains_pointer() check prevents the panel from hiding in this case. Now I understand why they had this check there :-D .

The problem is I see no way of fixing this. If we leave the check there we of course reintroduced the bug we wanted to fix, but if we remove it the misfired leave event will hide the panel.

The only thing I wasn't able to work out is why I don't see this bug on my production machine. I have mate-panel-1.20.1 without this commit reversed and on this machine it works fine. There has to be a difference in one of the packages.

Any ideas?

aaaaadrien commented 6 years ago

Hi, with 1.20.2 version, the problem comes back !

monsta commented 6 years ago

It surely comes back as we've reverted the fix which caused a regression