jun7 / rox-filer

ROX file manager
24 stars 6 forks source link

Some right-click options don't work in unfocused window #181

Closed JakeSFR closed 6 years ago

JakeSFR commented 6 years ago

To reproduce:

  1. Open two filer windows - one of them is focused, the other one isn't.
  2. Right-click on empty space in the unfocused window.
  3. Select e.g. 'New -> Blank file' or 'Help -> About ROX-Filer...' - nothing happens.
  4. Do it (3) again - it works this time (because now the window is focused).

We're using current master in Fatdog64.

jun7 commented 6 years ago

Is it newer versions bug?

JakeSFR commented 6 years ago

Well, the bug is not present in ROX build from 2017.12.

JakeSFR commented 6 years ago

Btw, were you able to reproduce this bug at all?

jun7 commented 6 years ago

No. my window manager gives focus before the popup of the menu. So I will use another WM to reproduce it. which one are you using?

JakeSFR commented 6 years ago

I've encountered it with Openbox and JWM.

Technically, they also give focus before the popup, but despite that the bug still happens if the window was initially unfocused...

jun7 commented 6 years ago

Hmm, Not reproduced. Do items of 'Next Click', 'Select' and 'Display' in the menu works? or do you have any clue to reproduce it?

JakeSFR commented 6 years ago

Hmm, Not reproduced.

Hmm, it seems to happen only in VirtualBox and sometimes in QEmu. Just tried it on real hardware and couldn't reproduce it as well. Sorry about that - we're developing a new release of Fatdog and I'm still running it mostly in VirtualBox.

But still, it doesn't happen, even in VBox, with our previous ROX build, from 2017.12...

Anyway, this may suggest that it might be some timing issue perhaps? Maybe ROX does not receive the signal that the window is already focused quick enough?

Do items of 'Next Click', 'Select' and 'Display' in the menu works?

No, they don't.

What works is:

or do you have any clue to reproduce it?

Perhaps you could try it in some "slower" environment like VirtualBox, maybe even directly in latest Fatdog. Here's current (development) ISO: http://distro.ibiblio.org/fatdog/broken/800pre/

We use some custom patches for ROX, but I've also built it without them and the problem persists.

Just note, that there is currently a bug, probably related to kernel 4.18.5, that may prevent showing the desktop (black screen), until you hover mouse pointer over virtual machine's window and move it a little or press any key a few times.

jun7 commented 6 years ago

Thank you for very interesting infomations!

JakeSFR commented 6 years ago

Here's something that might help to pinpoint the culprit, I hope. Note that (as I mentioned elsewhere) I'm not really familiar with ROX's internals and have only limited knowledge of C & GTK, so the below was just stab in the dark.

Anyway, I added a delay in menu.c, at line 874:

    appmenu_remove():
    sleep(1);
    window_with_focus = filer_window;

to see if it would improve the situation. But what happend was quite opposite - now it doesn't work at all, even if the window is already focused! So, indeed it looks like some timing issue...

jun7 commented 6 years ago

So, may the commit above changes the timing?

jun7 commented 6 years ago

It is reproduced with your 'sleep(1)' even on my pc and on the commit above with the 'sleep(1)', the menu items work.

So I think the commit may fixed this isssue. Is it fixed?

JakeSFR commented 6 years ago

Yes it is - I just built it and can't reproduce it anymore.:)

Thanks a lot!

jun7 commented 6 years ago

It delays refresh of the paste item of the menu. So could you check whether the paste is enabled or not?

JakeSFR commented 6 years ago

Not sure if this is what you mean, but I just tried this, multiple times:

  1. Selected some files -> right-click -> Copy
  2. Entered some dir -> right-click -> Paste

and it works, as usual.

JakeSFR commented 6 years ago

Oh, and if the clipboard is empty, the 'Paste' option is grayed out, as it should be.

jun7 commented 6 years ago

The original src enables the paste item if there was clipboard data but the getting clipboard data is slow and has async func. I changed it to use async func. So I thought dose it works on slow env?

jun7 commented 6 years ago

Anyway it seems works. Thank you for reporting! It was very interesting.

JakeSFR commented 6 years ago

No problem and thanks again.

Cheers!