Giter VIP home page Giter VIP logo

Comments (28)

veksha avatar veksha commented on July 26, 2024 1

oh, it's because I have maximized window.
it happens on resize.

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024 1
self.memo.focus() # handy, but can be annoying to some

it was added to make terminal focused after MANUAL resizing of bottom panel.
and on Windows and Linux-gtk it was playing fine with maximized window on app startup.

but qt5 version calling on_resize event even on initial maximized state on startup.

I guess I will just disable this code for now.
thanks again!

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024
  1. Need to think
  2. Hotkey only for top menu item? I understand it - handling of top menu hotkeys is built in in Lazarus. If you want to ignore some hotkey , try to handle it in on_key_down

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

trying to repeat the 1) but Cud always starts with Console active - even if I activate 'ExTerminal 1' , after restart Cud don't show ExTerminal! do you see it?

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

trying to repeat the 1) but Cud always starts with Console active - even if I activate 'ExTerminal 1' , after restart Cud don't show ExTerminal! do you see it?

no. "ui_bottom_on_start" option is not set to default?

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

It was '0' which is default! after removing line in user.json - all works again. will see it.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

found the reason - bug was visible IF session didn't have ui-tabs... fixed.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

@veksha

on Cud startup focus goes to Editor on Windows (not to opened ExTerminal), but on Linux it goes to ExTerminal (which is bad).

cannot see it here!
focus goes to editor. linux gtk2 version.

try on clean Cud with only ExTerminal, pls.

a1

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

gtk2: OK
qt5: BAD

I tend to always use qt5 version of CudaText.
don't know why. maybe because qt5 is not as old as gtk2? (2011 vs 2020)

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

qt5 has good Laz maintainer. if we find bug there, its better.
looking.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

looked. qt5 version - also all OK here. I cannot see initially focused terminal.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

some steps on clean Cud with ExTerm?

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

let's create Cud issue?

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

let's create Cud issue?

I'm starting to think it's a ExTerminal bug. (I have on_resize event)

Although it is interesting how gtk and qt behaves differently when maximized at startup.
but when I resize window it behaves similarly on both gtk and qt.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

how gtk and qt behaves differently

usual situation.

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

let's talk about second issue:

  1. Hotkey only for top menu item? I understand it - handling of top menu hotkeys is built in in Lazarus. If you want to ignore some hotkey , try to handle it in on_key_down

consider this situation on Linux:

  1. set hotkey in Cud so F10 key will open Options Editor Lite
  2. focus ExTerminal, press F10
  3. OEL will show up. even though I have return False in form_key_down:
elif key == keys.VK_F10:
      self.write(ctrl.ESC+'[21~')
      return False

from wiki: If plugin returns False, key is blocked.

on Linux it is not blocked whether you return True or False or None.
on Windows it is always blocked.

maybe this happens for bottom panels only?

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

not for bottom panels only- for all controls on a form. happens when 'hotkey' is set in the MainMenu (top menu bar). so - key goes to MainMenu handler before our 'on_key_down' . sad!

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

so can I help more?

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

can be some bug in lazarus (difference between win/qt/gtk versions).
it would be good to check if we can make some workaround in pascal code to make uniform behaviour for all systems/backends.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

quickly looked at app. cannot find the reason why 'memo' is focused. will try to create pascal demo for me.

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

i'm talking about hotkey issue. focus issue can be fixed in plugin, i think.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

Hotkey handling by MainMenu is heavy issue, seems not solvable by me (and we have macOS)

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

About focusing issue. made some digging.
I placed 'breakpoint' in IDE on EditorFocus() in unit proc_editor.
qt5 version.

  • if app not maximized, its called only 1 time on start - for the main editor tab. Called from FormShow() as 'stack trace' shows.
  • if app maximized (in prev session), its called 2nd time - from some Py code! because 'stack trace' window shows its called from api_ed_focus().

To find from WHAT Py code it was called (2nd time) i need to make some printing of stack-trace of Py code in cudatext.py in def focus(). Can you try it pls? or I will do

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

I don't know how to use this..
https://docs.python.org/3/library/traceback.html

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

ok, digged this more. added to cudatext.py to def focus:

    def focus(self):
        print(traceback.print_stack())
        return ct.ed_focus(self.h)

this shows that ExTerm is culprit!

Python 3.8.10
Init: cuda_exterminal
Init: cudatext
Startup: 450ms, plugins: 40ms (exterminal 43ms)
  File "/home/user/.config/cudatext/py/cudatext.py", line 1172, in _timer_proc_callback_proxy
    return _live[info](tag)
  File "/home/user/.config/cudatext/py/cuda_exterminal/terminal.py", line 432, in terminal_resize
    self.screen.resize(self.visible_lines,self.visible_columns-3)
  File "/home/user/.config/cudatext/py/cuda_exterminal/memoscreen.py", line 74, in resize
    self.memo.focus() # handy, but can be annoying to some
  File "/home/user/.config/cudatext/py/cudatext.py", line 1348, in focus
    print(traceback.print_stack())
None

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

thank you for investigation!

from cuda_exterminal.

veksha avatar veksha commented on July 26, 2024

resizing of bottom panel is triggered even on manual resizing of the whole window. (obviously)
so this code is bad anyway.

from cuda_exterminal.

Alexey-T avatar Alexey-T commented on July 26, 2024

yes

from cuda_exterminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.