Recent

Author Topic: Editor is loosing the focus  (Read 1985 times)

Gerold_R

  • New Member
  • *
  • Posts: 12
Editor is loosing the focus
« on: October 14, 2020, 07:26:49 pm »
Hello

I am switching from Windows to Linux (Mint) and Delphi 7 to Lazarus, so I am Lazarus beginner.

First I tried to setup Lazarus so that it feels a bit like my Delphi 7 config cause I am quite old and don't like changes anymore.

ALT-F9 is assigned to Quick-Compile but always when I press it to see if there are still some errors while converting a Delphi 7 project to Lazarus, the editor is not the active window anymore. It's the message window. How can I avoid this? It realy drives me crazy.

Same problem using Windows. If someone has an idea how to solve it at least under Windows, that would be fine.

Thanks for an answer.
Gerold
« Last Edit: October 14, 2020, 07:31:37 pm by Gerold_R »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: Editor is loosing the focus
« Reply #1 on: October 14, 2020, 07:38:01 pm »
Menu: Tools > Options > Environment > Message Window
"Focus Msg win at compilation"

Gerold_R

  • New Member
  • *
  • Posts: 12
Re: Editor is loosing the focus
« Reply #2 on: October 14, 2020, 11:52:22 pm »
Thanks. Didn't see this option. Works at least when I use the keyboard not using the mouse.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Editor is loosing the focus
« Reply #3 on: October 15, 2020, 12:06:14 am »
Hi!

If you click around nervous on your desktop while fpc compiles then a
different window will get the focus.

That is how the mouse works.

Winni

Gerold_R

  • New Member
  • *
  • Posts: 12
Re: Editor is loosing the focus
« Reply #4 on: October 15, 2020, 07:49:41 am »
If you click around nervous on your desktop while fpc compiles then a
different window will get the focus.

I dont click around nervous on my desktop. Just the quick compile button in the IDE coolbar.

The name of the option is
"Focus messages at compilation"
not
"Focus messages at compilation when your start the compile process using the keyboard"

So it seems to be a bug for me.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: Editor is loosing the focus
« Reply #5 on: October 15, 2020, 12:46:49 pm »
Are you sure focus goes to the message window, when you click the "run" button?

For me it goes to the ide-main bar (the window holding the menu and toolbar). This is normal. A mouse click moves focus.

I understand that does not help you. And one may argue that its not particular useful (the message window actually is useful, as some people navigate to the error messages by keyboard).
But useful or not, its the default behaviour, and (afaik) nothing else has ever been implemented (but I may be wrong, maybe it has, and is broken // Actually a very distant memory rings, that there may be cases where the IDE bar returns/restores focus, not sure what cases).

In any case, I would think it a reasonable feature if the run button (and other ide-main-window-toolbare-btn) would restore focus to the window that had focus before.

Maybe someone knows if it is a missing feature or broken feature (I suspect: missing).

In any case you could add a feature request (bug tracker / might sometimes be some long time until someone volunteers), or look into providing a patch.

----
One more note:
I do not know if you use Anchordocking with/without sparta-form..... (I don't, I also don't make to much use of the mouse / but those are personal choices).

Anchordocking is still somewhat newer, and has its own additional issue (though I tested this issue and this problem exists without AnchorDocking).
If you do you should mention this on a bug/feature report/request.

Afaik most of the core developers use floating windows. So AnchorDocking only gets fixed if bugs are reported.




Gerold_R

  • New Member
  • *
  • Posts: 12
Re: Editor is loosing the focus
« Reply #6 on: October 17, 2020, 02:30:40 pm »
Are you sure focus goes to the message window, when you click the "run" button?

You did not understand me. Sorry for my english. The topic is, "Editor is loosing the focus".

I have disabled the option:
Tools > Options > Environment > Message Window "Focus Msg win at compilation"

When the editor has the focus and I click on the Quick Compile" button in the toolbar, than the behaviour is not the same as when I press Alt-F9.

If there are still errors in the code, the editor remains the active window in both cases (mouse or keyboard used to quick compile)

If there are no more errors in the code and I use Alt-F9, the editor remains the active window, but NOT when I use the mouse.
At least right now, while I am working under Windows 7 to convert an old program.

But dont worry. I do not switch very often between mouse and keyboard and you gave me the hint with the "Focus Msg win at compilation" option. This helped me a lot and that was all I wanted. Thanks again.


For me it goes to the ide-main bar (the window holding the menu and toolbar). This is normal. A mouse click moves focus.

Well, depends on the program and how it is designed.

I do not know if you use Anchordocking with/without sparta-form..... (I don't, I also don't make to much use of the mouse / but those are personal choices).

Anchordocking is still somewhat newer, and has its own additional issue (though I tested this issue and this problem exists without AnchorDocking).
If you do you should mention this on a bug/feature report/request.

I never heard about it and I will have a look at it. What I dont like when using Lazarus under Linux Mint 20 Cinnamon is, after minimizing Lazarus I can not just restore Lazarus. I have to restore each Lazarus Window one by one.


Sieben

  • Sr. Member
  • ****
  • Posts: 310
Re: Editor is loosing the focus
« Reply #7 on: October 17, 2020, 03:16:56 pm »
Did you try Tools/Desktops...? It might get a bit confused on the z-order of windows but at least they restore.
Lazarus 2.2.0, FPC 3.2.2, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Editor is loosing the focus
« Reply #8 on: October 17, 2020, 05:17:23 pm »
What I dont like when using Lazarus under Linux Mint 20 Cinnamon is, after minimizing Lazarus I can not just restore Lazarus. I have to restore each Lazarus Window one by one.
Options -> Environment -> Window -> Show single button in TaskBar
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Editor is loosing the focus
« Reply #9 on: October 17, 2020, 06:47:49 pm »
What I dont like when using Lazarus under Linux Mint 20 Cinnamon is, after minimizing Lazarus I can not just restore Lazarus. I have to restore each Lazarus Window one by one.

That's probably a "gimmick" of the window/desktop manager. Here, in various [Xu, Ku, U]buntu, it usually restores all windows except when you fiddle with individual ones like, say, restoring just the editor or message window and minimizing it again.

Using the option to which Juha's pointed is one option though I, personally, prefer to see all windows in the taskbar so that it's easier to select and manage each one. 
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018