Bug 283518 - geometry for terminals should be in chars, not pixels
Summary: geometry for terminals should be in chars, not pixels
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 4.7.1
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 285012 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-07 08:34 UTC by Jiri Slaby
Modified: 2011-12-07 13:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Slaby 2011-10-07 08:34:52 UTC
Version:           4.7.1 (using KDE 4.7.1) 
OS:                Linux

I use xterm as a terminal. It would be great, if, when resized, the shown size of the window would be in characters, not pixels.

I think, I already saw the size in characters 2 months ago, but now, it's back to pixels. Is this configurable somehow?

Reproducible: Always



Expected Results:  
Instead of 500x494, I would like to see 100x80 characters.
Comment 1 Martin Flöser 2011-10-07 16:00:52 UTC
I'm sorry but we won't implement this. Sizes are in pixel, we cannot introduce a completely different handling just for one type of application and it would not work correctly as the clients (xterm) would still need everything in pixels.

I mark as wontfix as I think it is more honest to say that we won't implement something than keeping the wish open.

Feel free to propose this as an idea on brainstorm.forum.kde.org in order to find out if it is a feature wanted by many users.
Comment 2 Thomas Lübking 2011-10-07 20:44:42 UTC
While in general having to second Martin, i'd like to record that a possible implementation would just show  size/baseincrement

(reading this bug, i suddenly got aware why xterm & gtkterm probably set a baseincrement > 1, i though prefer the konsole approch - but maybe for the resulting look ;-)
Comment 3 Thomas Lübking 2011-10-26 15:47:24 UTC
*** Bug 285012 has been marked as a duplicate of this bug. ***
Comment 4 Martin 2011-10-26 16:00:10 UTC
Thanks to Thomas Lübking to mark my newly submitted bug 285012 as a duplicate of this one - I did a search for a similar submission first but could not find it.

As I answered to Martin Gräßlin in bug 285012, please reopen this bug. The necessary information is available to the window manager via WM_NORMAL_HINTS, and it must already be used there, otherwise maximizing xterms would not work correctly (compare with bug 269662).

Also, in KDE 4.6.5 the resize information was already shown properly scaled such that it makes sense for terminals (see also the comment by Jiri Slaby that he already saw this working correctly), and I am sure one can find examples of other applications which sport size increments greater than one.

As for "use the KDE terminal instead": This unfortunately is not an option in my situation, as I am displaying an xterm from a remote machine which does not run KDE at all (nor would it be able to).

So, to wrap it up - please reopen the bug and fix it! (which should be easy for hardened KDE hackers)
Comment 5 Thomas Lübking 2011-10-26 16:10:10 UTC
It's true that the uncomposited box shows the size/increment ratio, so this is in fact a regression (which i introduced with the effect plugin, so it's my bug :)
Comment 6 Martin 2011-10-26 16:24:39 UTC
Thank you!
Comment 7 Thomas Lübking 2011-10-26 16:25:47 UTC
Addendum:
The baseincrement is yet not exported to the effectWindows, so this is no nobrainer but requires a decision about whether this property (or geometry restrictions in general) should be known to the effects.
Comment 8 Thomas Lübking 2011-11-03 20:50:38 UTC
Git commit 3b6514d12639be222e520e4ff9a776be1017c05b by Thomas Lübking.
Committed on 02/11/2011 at 23:05.
Pushed by luebking into branch 'master'.

export the baseincrement size to the effectwindow and utilize it in the windowgeometry effect

BUG: 283518
REVIEW: 103033
FIXED-IN: 4.8

M  +1    -0    kwin/client.h
M  +6    -0    kwin/effects.cpp
M  +1    -0    kwin/effects.h
M  +3    -1    kwin/effects/windowgeometry/windowgeometry.cpp
M  +5    -0    kwin/geometry.cpp
M  +6    -1    kwin/libkwineffects/kwineffects.h

http://commits.kde.org/kde-workspace/3b6514d12639be222e520e4ff9a776be1017c05b
Comment 9 Jiri Slaby 2011-11-06 22:42:53 UTC
(In reply to comment #8)
> Git commit 3b6514d12639be222e520e4ff9a776be1017c05b by Thomas Lübking.
> Committed on 02/11/2011 at 23:05.
> Pushed by luebking into branch 'master'.
> 
> export the baseincrement size to the effectwindow and utilize it in the
> windowgeometry effect

Thanks, but the size reported is invalid. Width is real width+2, height is real+1.
Comment 10 Jiri Slaby 2011-11-06 22:44:16 UTC
(In reply to comment #9)
> height is real+1.

Actually +2 too.
Comment 11 Thomas Lübking 2011-11-13 17:40:48 UTC
Git commit 245a56e4ef07519282ef1176af59a4f1f1798ca4 by Thomas Lübking.
Committed on 13/11/2011 at 18:38.
Pushed by luebking into branch 'master'.

use contentsrect to calculate window size if baseUnit isn't 1,1

BUG: 283518

M  +6    -2    kwin/effects/windowgeometry/windowgeometry.cpp

http://commits.kde.org/kde-workspace/245a56e4ef07519282ef1176af59a4f1f1798ca4
Comment 12 Jiri Slaby 2011-11-25 09:39:14 UTC
Works great, thx.
Comment 13 Jiri Slaby 2011-12-07 10:26:27 UTC
One more issue. The xterm windows cannot be resized by borders now. It thinks that the mouse is at 20 pixels instead of 20*character width/height pixels.

I.e. when you start resizing, the window immediately shrinks by multiple of character width/height.

For example when the window has pixel width 700 pixels (i.e. 114 characters) and you start resizing, the window immediately shrinks to 114 pixels.
Comment 14 Jiri Slaby 2011-12-07 10:27:36 UTC
(In reply to comment #13)
> One more issue. The xterm windows cannot be resized by borders now.

(This means alt+mouse button works fine.)
Comment 15 Thomas Lübking 2011-12-07 13:10:54 UTC
This is most unlikely related (i doubt it could be worked around by deactivating the effect?), but possibly bug #288394

a) on what KDE version does this happen
b) do you use some aurorae theme decortion?
c) do you use Qt4.8 (beta)

anyway, it's a different issue - please open a new bug instead of turning this one into another topic (makes triaging a nightmare) - thanks.