1

In PcManFM, I right click a pdf file, and set up in "Open With..." to use a Windows program run under Wine to open pdf files.

Now when I double click a pdf file, the Windows program starts and open the pdf file. But the window for the program is not in the front, i.e. doesn't have the focus. How can I make it in the front by default after I double click a pdf file?

Note that my problem only happens to the Windows program that I added, not to other programs. When I open pdf files with other programs such as evince, the new windows are in the front.

I googled the problem, and a solution to a similar problem is from https://askubuntu.com/a/671702/1471:

The command above didn't work for me and I didn't want to install CCSM, so I did some digging and found that the following command did the trick (I'm using Ubuntu 15.04):

dconf write /org/compiz/profiles/unity/plugins/core/focus-prevention-level 0

Edit: This solution still works for 16.04

But

  • my DE is LXDE, while dconf is a GNOME technology used to store application settings.

  • Moreover, LXDE's default window manager is OpenBox instead of Compiz.

So how shall I solve my problem?

Thanks.

Tim
  • 25,177
  • From a quick google, you might find an answer here or here – wjandrea Jun 15 '17 at 16:33
  • Thanks. The first link seems to say my problem is a feature of OpenBox. But my problem only happens to the Windows program that I added to "Open With..", not to other programs already shown after right click. When I open pdf files with other programs such as evince, the new windows are in the front. – Tim Jun 15 '17 at 17:22

1 Answers1

0

In compiz, there is focus stealing prevention is feature which is causing the issue.

CompizConfig Setttings Manager -> General Settings -> Focus & Raise Behaviour -> Focus Prevention Level --> Off

Screen Grab

Now all your windows will pop up when called.