Summary: | "Terminal Size" setting in profile ignored | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Kenneth Graunke <kenneth> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aacid, arequipeno, butirsky, cenbe, daniel, dode, eric.brunet, exanime, galalleni, hyslion, jc, jcdyer78, jeremy9856, jwelsh, michael.petzold, michal.zajac+kde.org, mitchnull+kde, philip.smith.ucl, rapar, rdieter, rubin, scottn, simonandric5, subdiff, suicidaleggroll, terry, wibble, wstrecke |
Priority: | NOR | ||
Version: | master | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=439339 | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Workaround to force the terminal size from the profile |
Description
Kenneth Graunke
2015-03-21 21:21:16 UTC
I think I was wrong in my earlier assessment -sorry for overcomplicating the report. Here's a much simpler report. Even with "Use current window size on next startup" unchecked, Konsole simply ignores the profile's preferred window size, and uses some default size. I built Konsole from source, and verified that - ~/.local/share/konsole/Shell.profile does contain TerminalRows=75 - ~/.config/konsolerc does not contain any Height/Width lines - Konsole does read my profile settings, and sets the Session's preferredSize correctly. - Konsole::Session::updateTerminalSize somehow has the wrong number of rows/columns. So it looks like the information is getting lost somehow, or overridden...I'm having a hard time following the code to figure out why. I can confirm this. Running Kubuntu 15.04 and this is definitely broken. Also confirmed on Fedora 22. Confirmed again on f22 Confirmed on OpenSUSE Tumbleweed Konfirmed in Debian stretch/testing. I have QHD graphics (3840x2160), with "Force Fonts DPI" set to 144, and the text size set to 14pt Oxygen Mono, and the window always opens to a mostly useless 36c x 14r, regardless of how I edit my profile settings. I can confirm this one Debian Sid amd64 Linux 4.1.3 plasma-desktop 4:5.4.1-1 konsole 4:15.08.0-1 Confirm this is happening too. Is anyone looking into this? This is a regression from KDE 4, it's affecting a lot of people in a core developer application, and is really easy to reproduce - pretty much anyone looking for a fixed-size terminal (say, 80 characters wide) doesn't get one. I imagine it's a pretty simple fix... *** Bug 345138 has been marked as a duplicate of this bug. *** Still an issue in Debian Sid... plasma-desktop 4:5.4.2-1 *** Bug 343321 has been marked as a duplicate of this bug. *** I spent some time poking around with gdb, and I *think* that I might have some idea what the problem is. TerminalDisplay::setSize(), which does get called with the correct columns/lines, calculates a pixel-based size for the widget and sticks it in TerminalDisplay::_size. That value will be returned by TerminalDisplay::sizeHint(). It then calls QWidget::updateGeometry(), which would normally update the layout system. A bit later, TerminalDisplay::calcGeometry() is called to recalculate TerminalDisplay::_contentRect. It uses the present widget area, as returned by QWidget::contentsRect(), as its starting point. I suspect that the authors of this code assumed that the call to QWidget::updateGeometry() in TerminalDisplay::setSize() would update the state of the widget, causing the call to QWidget::contentsRect() in TerminalDisplay::calcGeometry() to return a result that reflects the new size. Unfortunately, this is not the case; in fact, it seems to have no effect at all. I can't help wondering if this is a change from Qt4 to Qt5. Just for grins I went back to konsole v4.12.19 (commit 232af90a032d0984b0121aa6ea3ad982cdec9635 from 24 March, 2014). The geometry & resizing code in TerminalDisplay.cpp looks very similar -- possibly even completely unchanged -- and the behavior is almost identical. The difference is that TerminalDisplay::calcGeometry() is called an additional (2nd) time after TerminalDisplay::setSize(). This time QWidget::contentsRect() does return an update size. So it looks like my assumption about the way this code is intended to work is likely correct. Here is the backtrace from the 2nd call call to TerminalDisplay::calcGeometry(): #0 Konsole::TerminalDisplay::calcGeometry (this=this@entry=0x8a06f0) at /home/ipilcher/konsole/src/TerminalDisplay.cpp:1684 #1 0x00007ffff795f22d in Konsole::TerminalDisplay::makeImage (this=this@entry=0x8a06f0) at /home/ipilcher/konsole/src/TerminalDisplay.cpp:1657 #2 0x00007ffff7961797 in Konsole::TerminalDisplay::updateImageSize (this=0x8a06f0) at /home/ipilcher/konsole/src/TerminalDisplay.cpp:1626 #3 0x00007ffff49d4140 in QWidget::event(QEvent*) () from /lib64/libQtGui.so.4 #4 0x00007ffff796600a in Konsole::TerminalDisplay::event (this=0x8a06f0, event=0x7fffffffce30) at /home/ipilcher/konsole/src/TerminalDisplay.cpp:3027 #5 0x00007ffff497d93c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #6 0x00007ffff4984796 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #7 0x00007ffff680654a in KApplication::notify(QObject*, QEvent*) () from /lib64/libkdeui.so.5 #8 0x00007ffff5af38dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4 #9 0x00007ffff4a1be61 in QWidgetPrivate::setGeometry_sys(int, int, int, int, bool) () from /lib64/libQtGui.so.4 #10 0x00007ffff49cbb75 in QWidget::setGeometry(QRect const&) () from /lib64/libQtGui.so.4 #11 0x00007ffff49aa36d in QLayoutPrivate::doResize(QSize const&) () from /lib64/libQtGui.so.4 #12 0x00007ffff497d90e in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #13 0x00007ffff4984796 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #14 0x00007ffff680654a in KApplication::notify(QObject*, QEvent*) () from /lib64/libkdeui.so.5 #15 0x00007ffff5af38dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4 #16 0x00007ffff4a1be61 in QWidgetPrivate::setGeometry_sys(int, int, int, int, bool) () from /lib64/libQtGui.so.4 #17 0x00007ffff49cbb75 in QWidget::setGeometry(QRect const&) () from /lib64/libQtGui.so.4 #18 0x00007ffff49adf5d in QWidgetItem::setGeometry(QRect const&) () from /lib64/libQtGui.so.4 #19 0x00007ffff498cd00 in QBoxLayout::setGeometry(QRect const&) () from /lib64/libQtGui.so.4 #20 0x00007ffff49aa36d in QLayoutPrivate::doResize(QSize const&) () from /lib64/libQtGui.so.4 #21 0x00007ffff49abf40 in QLayout::activate() () from /lib64/libQtGui.so.4 #22 0x00007ffff497d90e in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #23 0x00007ffff4984796 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4 #24 0x00007ffff680654a in KApplication::notify(QObject*, QEvent*) () from /lib64/libkdeui.so.5 #25 0x00007ffff5af38dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4 #26 0x00007ffff5af6ef6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQtCore.so.4 #27 0x00007ffff5b23d1e in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQtCore.so.4 #28 0x00007fffee41de3a in g_main_dispatch (context=0x6c31f0) at gmain.c:3154 #29 g_main_context_dispatch (context=context@entry=0x6c31f0) at gmain.c:3769 #30 0x00007fffee41e1d0 in g_main_context_iterate (context=context@entry=0x6c31f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840 #31 0x00007fffee41e27c in g_main_context_iteration (context=0x6c31f0, may_block=1) at gmain.c:3901 #32 0x00007ffff5b23e8e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #33 0x00007ffff4a263e6 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtGui.so.4 #34 0x00007ffff5af2151 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #35 0x00007ffff5af24c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4 #36 0x00007ffff5af8069 in QCoreApplication::exec() () from /lib64/libQtCore.so.4 #37 0x00007ffff7bd0eaa in kdemain (argc=3, argv=0x7fffffffde38) at /home/ipilcher/konsole/src/main.cpp:86 #38 0x00007ffff2954580 in __libc_start_main (main=0x400860 <main(int, char**)>, argc=3, argv=0x7fffffffde38, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffde28) at libc-start.c:289 #39 0x0000000000400899 in _start () It looks like it's processing a resize event, but I'm unable to figure out where this event was generated. Was it explicitly generated elsewhere in the konsole code, or was created automatically by Qt4 because of the earlier QWidget::updateGeometry() call with a new _size? I can see this bug in fedora 23. One can get around it by making a windows rule, but it is annoying. Confirmed on Manjaro Created attachment 95952 [details]
Workaround to force the terminal size from the profile
I'm not familiar enough with the code to provide a proper fix, but at least this patch makes konsole usable again for me. It breaks the "Use current window size on next startup" option though.
It's a 10 months bug that seems to be an easy one to fix. Can it be fixed please for the 15.12 release ? Thank you ! Same issue here for a long, long time. Yes, it would be nice to finally have a fix. Thanks. 15.12 release is almost here. Maybe for 15.12.1 ? Nobody seem to care about this little bug. I confirm that I can't re-size Konsole through the profile. If this option doesn't work, then I'll never consider switching to Konsole as a default terminal, which is basically the reason why I tried re-sizing it in the first place. It would be good to see this fixed. It's not good to have non-working configuration options in such a high-profile Plasma app. Won't someone please address this? Could someone just review the change proposed by Daniel Scharrer? (Just check if it doesn't cause any serious damage, and apply it as a quick-fix until someone can look into the issue deeper). This issue is really annoying... in Comment 17(In reply to Daniel Scharrer from comment #17) > Created attachment 95952 [details] > Workaround to force the terminal size from the profile > > I'm not familiar enough with the code to provide a proper fix, but at least > this patch makes konsole usable again for me. It breaks the "Use current > window size on next startup" option though. A reminder for this that need to be fixed. Another reminder that this is causing users pain. Hi! FYI I requested a review for a possible fix: https://git.reviewboard.kde.org/r/126924/ The maintainer Kurt plans to look on the patch in the next few days. But I have not much experience in coding KDE stuff. So don't expect the fix to be perfect. It could also be the case, that it's not acceptable at all. You can still try it out though if you wish to by downloading the diff and compiling Konsole yourself with the patch (git apply mypatch). In any case, if there is something you want to have changed about the patch, just tell me. Thanks for the patch. I have created an updated kconsole5 rpm with this and am trying it out now. So far its appears to work fine :) Git commit 55f02e5b8e3e2395050940c33c97306311192e18 by Kurt Hindenburg. Committed on 30/01/2016 at 17:09. Pushed by hindenburg into branch 'master'. Allow profile's termainal size to work again When Konsole Settings -> 'Use current window size on next startup' is disabled, use the Profile's terminal size for new windows. Many thanks to Roman Gilg (subdiff gmail com) for research and patch. If there are no further issues, I'll commit to 15.12 branch (should go .2 release). REVIEW: 126924 M +24 -7 src/Application.cpp M +2 -1 src/Application.h http://commits.kde.org/konsole/55f02e5b8e3e2395050940c33c97306311192e18 Thank you very very much Roman Gilg (subdiff) ! Cheers Roman and Kurt! Maybe we should mark it as FIXED ? Git commit 1e211482566edb9194f34755b823bd98f15c6f25 by Kurt Hindenburg. Committed on 06/02/2016 at 15:11. Pushed by hindenburg into branch 'Applications/15.12'. Allow profile's termainal size to work again When Konsole Settings -> 'Use current window size on next startup' is disabled, use the Profile's terminal size for new windows. Many thanks to Roman Gilg (subdiff gmail com) for research and patch. If there are no further issues, I'll commit to 15.12 branch (should go .2 release). REVIEW: 126924 (cherry picked from commit 55f02e5b8e3e2395050940c33c97306311192e18) M +24 -7 src/Application.cpp M +2 -1 src/Application.h http://commits.kde.org/konsole/1e211482566edb9194f34755b823bd98f15c6f25 The setting works again, but it doesn't take into account if the menu bar is disabled or not (apparently it always assumes that it is enabled and calculates the size based on that). I have the menu bar disabled, thus I have to set the size to 80x23 to get a 80x25 window. If I turn the menubar on, I'll get a 80x23 window with menubar (as set in the settings). Thanks for feedback. Did I understand correctly that this is only a non critical problem because there is the workaround of just applying some different size (in your case 80x23 instead of 80x25)? In this case I would ignore that for the moment, because there seems to be some bigger transition going on in the Konsole Source (moving away from KUniqueApplication), which also could affect our fix for this bug. (In reply to subdiff from comment #35) Yes, I can use the workaround for now (in fact, I have been using another workaround on my main computer until now ;), just wanted to let you know that the fix is not "perfect" :) Radics, i suggest opening a new bug with a clearer description for that "ignores menubar" part (In reply to Albert Astals Cid from comment #37) > Radics, i suggest opening a new bug with a clearer description for that > "ignores menubar" part Done, see bug 359662. |