Version: (using Devel) Installed from: Compiled sources OS: Linux I am trying to embed the Konsole KPart in a plasma plasmoid using a QGraphicsProxyWidget. Unfortunately the text area of the terminal sits locked in the top left corner of the screen no matter where I place the QGraphicsProxyWidget in the scene. Interestingly the scroll bar is drawn correctly so I suspected the konsole might be doing something a little funny. I found three lines that move the konsole to the top left corner and reset the rotation. Removing them fixed my problem see attached patch for reference. Robert Knight explains the reason for the code. > They are there to support double width and double height lines. Not a hugely > important feature but it is there to make the "vttest" terminal test suite work > better. The code can be rewritten so that it pushes a new transform matrix onto > he stack and pops it afterwards rather than resetting the painter's world > transform back to the defaults after every line. PATCH: Index: TerminalDisplay.cpp =================================================================== --- TerminalDisplay.cpp (revision 816076) +++ TerminalDisplay.cpp (working copy) @@ -1390,8 +1390,8 @@ //transformation has been applied to the painter. this ensures that //painting does actually start from textArea.topLeft() //(instead of textArea.topLeft() * painter-scale) - QTransform inverted = paint.worldTransform().inverted(); - textArea.moveTopLeft( inverted.map(textArea.topLeft()) ); + //QTransform inverted = paint.worldTransform().inverted(); + //textArea.moveTopLeft( inverted.map(textArea.topLeft()) ); //paint text fragment drawTextFragment( paint, @@ -1404,7 +1404,7 @@ _fixedFont = save__fixedFont; //reset back to single-width, single-height _lines - paint.resetMatrix(); + //paint.resetMatrix(); if (y < _lineProperties.size()-1) {
Hi here is a patch that fixes this bug whilst not regressing in the vttest suite. See attached screen shot. Index: src/TerminalDisplay.cpp =================================================================== --- src/TerminalDisplay.cpp (revision 818969) +++ src/TerminalDisplay.cpp (working copy) @@ -1372,15 +1372,21 @@ _fixedFont = false; QString unistr(disstrU,p); + // Create a text scaling matrix for double width and double height lines. + QMatrix textScale; if (y < _lineProperties.size()) { if (_lineProperties[y] & LINE_DOUBLEWIDTH) - paint.scale(2,1); + textScale.scale(2,1); if (_lineProperties[y] & LINE_DOUBLEHEIGHT) - paint.scale(1,2); + textScale.scale(1,2); } + //Apply text scaling matrix. + paint.setWorldMatrix(textScale, true); + //calculate the area in which the text will be drawn QRect textArea = QRect( _leftMargin+tLx+_fontWidth*x , _topMargin+tLy+_fontHeight*y , _fontWidth*le @@ -1390,8 +1396,7 @@ //transformation has been applied to the painter. this ensures that //painting does actually start from textArea.topLeft() //(instead of textArea.topLeft() * painter-scale) - QTransform inverted = paint.worldTransform().inverted(); - textArea.moveTopLeft( inverted.map(textArea.topLeft()) ); + textArea.moveTopLeft( textScale.inverted().map(textArea.topLeft()) ); //paint text fragment drawTextFragment( paint, @@ -1404,7 +1409,7 @@ _fixedFont = save__fixedFont; //reset back to single-width, single-height _lines - paint.resetMatrix(); + paint.setWorldMatrix(textScale.inverted(), true); if (y < _lineProperties.size()-1) {
Created attachment 25237 [details] Vt Test running in plasmoid.
Hi Jared Can you attach the patch to the bug report using the "Create a New Attachment" link at the bottom of this report please. Posting the patch inline as part of a comment messes up the formatting. Adding patches as attachments also makes it possible to mark previous versions of a patch as obsolete.
Created attachment 26184 [details] Patch to fix 163178 Hi Robert, Patch is attached. The area of code I was changing used tab indentation. I used the same in my patch so it matches, hope this is ok. Kind Regards Jared
hi! i just wanted to ask if this patch will be merged any time soon. the konsole-plasmoid is really cool but can't be used as long as this patch isn't applied. is there a reason why this patch isn't applied? or maybe just forgotten. regards thomas prochaska
I have this up on reviewboard.kde.org. Do you have some way for me to test it? I'm not really up on plasma stuff.
Created attachment 32188 [details] Konsole Plasmoid Test Case This is a simple konsole plasmoid as a test case for this bug.
The test case won't compile on my 4.2 branch nor trunk. Here's 4.2 error: CMake Error at /mnt/kde/binaries/branches/KDE/4.2/share/apps/cmake/modules/FindPlasma.cmake:13 (message): FindPlasma.cmake is deprecated. Now with KDE 4.2 Plasma is part of kdelibs and automatically found using find_package(KDE4) instead. Replace the variables previously coming from FindPlasma.cmake as follows: PLASMA_OPENGL_FOUND -> KDE4_PLASMA_OPENGL_FOUND PLASMA_LIBS -> KDE4_PLASMA_LIBS PLASMA_INCLUDE_DIR -> KDE4_INCLUDE_DIR or KDE4_INCLUDES, should be already set anyway PLASMA_FOUND -> nothing, it's always there if KDE4, version 4.2 or newer has been found. If you see this error message in a module within KDE/, update it from svn, it has been fixed already. Call Stack (most recent call first): CMakeLists.txt:7 (find_package)
Created attachment 32324 [details] patch for the test-case hi! this patch should resolve the last reported cmake issue concerning the test-case (konsole plasmoid). regards thomas prochaska
Still can't compile the test case... no idea what's going on. I have all of trunk compiled before. Linking CXX shared module lib/plasma_applet_konsole.so CMakeFiles/plasma_applet_konsole.dir/konsoleapplet.o: In function `KonsoleApplet::qt_metacall(QMetaObject::Call, int, void**)': /home/kdetrunk/konsole-0.1/konsoleapplet.moc:60: undefined reference to `Plasma::Applet::qt_metacall(QMetaObject::Call, int, void**)'
Created attachment 33325 [details] fixes test-case CMakeLists.txt I managed to compile the test case with these changes (apply to Jared Kell's test case).
SVN commit 963912 by hindenburg: Fix issue where terminal text is locked at 0,0. BUG: 163178 M +12 -7 TerminalDisplay.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=963912