gedit window not automatically active

Asked by joe oettinger

With Unity 2D, when I open a file with Gedit (either from the terminal or from the file browser), the terminal or file browser remains the active window. In other words, I have to first click on the Gedit window for it to be active.

Of course, the intuitive way for things to work would be for the keyboard and mouse to be active in the file in Gedit when the file appears in Gedit.

I'm not sure if there's something I should be doing different or whether this is a bug in Unity. It wasn't a problem with Gnome in Ubuntu 10.04.

Thanks for any help.

Question information

Language:
English Edit question
Status:
Solved
For:
unity-2d Edit question
Assignee:
No assignee Edit question
Solved by:
joe oettinger
Solved:
Last query:
Last reply:
Revision history for this message
joe oettinger (joeoettinger) said :
#1

I notice that if I call gedit from the terminal with the option +1 thus:
  $ gedit +1 hello.c
the gedit window is active instead of the terminal window. But that shouldn't really be necessary.

Revision history for this message
joe oettinger (joeoettinger) said :
#2

So, here's a naïve hack that worked on my computer:

Edit .bashrc in your home file to add this:

    alias gedit='gedit +1'

Then reboot the computer. Then you can start editing the file as soon as you open it, both from the browser and from the terminal. At least it worked on my computer.

I'm a novice at this kind of thing, so I expect there's a better way, and Unity 2 should automatically activate the Gedit window when you open it.

Revision history for this message
Olivier Tilloy (osomon) said :
#3

This hack should indeed not be needed, it works around what seems to be a bug. I cannot reproduce the issue on my setup.
Can you consistently observe the issue across reboots? Is it just in Unity-2d, or does it also happen in a regular classic desktop session? Also, does it happen only with gedit, or also with other types of documents/applications (e.g. opening an .odt document with LibreOffice)?

Revision history for this message
joe oettinger (joeoettinger) said :
#4

Thanks so much, Olivier, for your attempt to help. Since I posted this
I've run the Update Manager, and that seems to have changed something
that solved the problem.

(I guess it doesn't matter at this point, but before that it was
happening on reboot of Unity 2D but not when I rebooted using Ubuntu
Classic, and the problem occurred when there was already a file in
Gedit).

But I certainly appreciate your reading my question and trying to help
me solve it.

Joe

On Mon, May 2, 2011 at 3:49 AM, Olivier Tilloy
<email address hidden> wrote:
> Your question #155039 on unity-2d changed:
> https://answers.launchpad.net/unity-2d/+question/155039
>
>    Status: Open => Needs information
>
> Olivier Tilloy requested more information:
> This hack should indeed not be needed, it works around what seems to be a bug. I cannot reproduce the issue on my setup.
> Can you consistently observe the issue across reboots? Is it just in Unity-2d, or does it also happen in a regular classic desktop session? Also, does it happen only with gedit, or also with other types of documents/applications (e.g. opening an .odt document with LibreOffice)?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/unity-2d/+question/155039
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
joe oettinger (joeoettinger) said :
#5

This is no longer a problem for me since installing the second set of updates with the Update Manager.

Revision history for this message
Olivier Tilloy (osomon) said :
#6

Awesome, glad to know the problem went away (even though I really wonder what fixed it…)!