zielmicha / emacs-android

Emacs port to Android.
141 stars 23 forks source link

Emacs is displayed curious when display size changed (i.e. by opening the soft keyboard) #15

Open ghost opened 11 years ago

ghost commented 11 years ago

When Emacs launches everything is displayed correctly. But after opening the keyboard Emacs is completely messed up. Due to the display size change the size of emacs changes too. So i.e. the menu panel is at another location but not drawn there. The display is only updated if the cursor moves there (or i.e. the line number changes). It is a big rag rug. Same for the Terminal IDE bash. I opened emacs in the terminal ide bash and it worked fine until I used the soft keyboard. By the way: I logged in via ssh from terminal ide to my gentoo and opened my "gentoo emacs" there and everything worked just fine with the soft keyboard!?!? Emacs resized with the keyboard.

Additional information: In the Terminal Emulator the ctrl key does not work and I get a seg fault when not using 4x8 font size. In Terminal IDE Emacs works with all font sizes and all keys like ctrl, alt, esc work just fine. AND Emacs works great in portrait mode! So why don't you use the terminal ide bash? There seems to be much less problems with keys, etc.?

Screenshots:

Emacs in Terminal Emulator after start: screenshot_2013-01-31_2120

Emacs in Terminal Emulator after closing keyboard: screenshot_2013-01-31_2123

Emacs in Terminal IDE after start: screenshot_2013-01-31_2133

Emacs in Terminal IDE after closing keyboard: screenshot_2013-01-31_2136

Gentoo Emacs via ssh in Terminal IDE: screenshot_2013-01-31_2147

Gentoo Emacs via ssh in Terminal IDE after closing the keyboard: screenshot_2013-01-31_2148

Emacs in portrait mode: screenshot_2013-01-31_2212

Edit: Added portrait screenshots

smtindall commented 11 years ago

1) I don't believe emacs was designed with support for soft keyboards built in. That said, you may just need to tell emacs what the new frame size is after the soft keyboard enters: M-x eval-expression RET (set-frame-size (selected-frame) x y) RET where x & y are the size of the frame after you open the soft keyboard, you may need to experiment a bit to get workable values. You will need to do something similar after the soft keyboard is closed.

ghost commented 11 years ago

But why does it work with my emacs via ssh on my gentoo linux? I tested a resize of my KDE terminal while running emacs. My "gentoo Emacs" doesn't end up in a rag rug!?!?!?

smtindall commented 11 years ago

Well, Android is a far cry from X11 and/or linux. I haven't worked directly with this port, but several guesses would include: A) Android handles window resizing in a completely different way than linux B) open/close on soft keyboard does not signal a change in window size the same way that resizing a terminal window under linux When you say your 'KDE terminal', I'm guessing this is a terminal emulator running under X11 on a linux system. The X window manager interacts with the terminal and programs running within the terminal emulator to provide signals and hooks for events like changes in windows size. Emacs responds to these by changing it's frame size in response to changes in terminal window size (assuming it is running console mode of course!). Android's window manager and/or the terminal emulator within which emacs is running are apparently not providing the same hooks for emacs to grab & respond to when the soft keyboard opens & closes. The same issue arises if you change the font size while emacs is running, which effectively changes the terminal size, but emacs doesn't get notified for some reason & has to be manually changed.

ghost commented 11 years ago

But why does it work then with my phone via ssh on my emacs on gentoo linux??? There shouldn't be send a "resize event" too!?!?!?

juan-g commented 11 years ago

If it works well on Android with other ways (ssh from mobile to remote Emacs), then it's probably a bug in this specific Android app (Emacs directly on mobile).

ghost commented 11 years ago

Yup. That's what I suggested.