User forums > Using Code::Blocks
Slow scrolling? [Ubuntu]
dmoore:
--- Quote from: oBFusCATed on July 23, 2012, 11:43:38 am ---
--- Quote from: jens on July 23, 2012, 11:40:07 am ---By the way making the amount of lines per wheel-click configurable is a good thing in my opinion.
Shall I prepare a patch for it ?
--- End quote ---
I think the problem with the scrolling is that there is no acceleration, not that the scrolling is slow.
At least firefox seems to have some acceleration in it, but I may be wrong as my mouse doesn't have a lock which limits the rotations (the mechanism making the mouse click when scrolling).
--- End quote ---
put another way, discarding mousewheel events prevents scrolling above a certain speed.
EDIT: I should add that I think making the mousewheel scrolling increment customizable is nonetheless a good idea. Happy to test a patch.
Jenna:
Could you please test the attached patch to Editor.cxx.
It should optimize scrolling of just a few lines, but at least on gtk (when calling ScintillaWX::ScrollText() ) it seems to slow down scrolling a lot.
dmoore:
--- Quote from: jens on July 23, 2012, 09:03:57 pm ---Could you please test the attached patch to Editor.cxx.
It should optimize scrolling of just a few lines, but at least on gtk (when calling ScintillaWX::ScrollText() ) it seems to slow down scrolling a lot.
--- End quote ---
Well done Jens! Looks like that's the fix. Many thanks. I don't think I would ever have found this myself. (Curious how you figured out that this was the problem).
This appears to fix mousewheel scrolling too! (or trackpad scrolling, at least)
So the odd thing is that, at least for me, those calls seemed to only create problems with C::B. When I run the STC sample I don't have a problem. Even if I put a scintilla widget in a separate window in C::B, which you think would be as close to the wxWidgets STC sample as possible, the problem returns. Is it possible that the drawing to screen was creating problems with wxAUI?
dmoore:
So this is odd:
--- Code: ---void Editor::ScrollText(int /* linesToMove */) {
//Platform::DebugPrintf("Editor::ScrollText %d\n", linesToMove);
Redraw();
}
--- End code ---
So if they hadn't done this
--- Code: ---void ScintillaWX::ScrollText(int linesToMove) {
int dy = vs.lineHeight * (linesToMove);
sci->ScrollWindow(0, dy);
sci->Update();
}
--- End code ---
(Editor is a base class of SctinillaWX)
Then there would be no lag.
dmoore:
So this patch actually seems to give slightly better performance
--- Code: ---Index: src/sdk/wxscintilla/src/ScintillaWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/ScintillaWX.cpp (revision 8138)
+++ src/sdk/wxscintilla/src/ScintillaWX.cpp (working copy)
@@ -417,7 +417,7 @@
void ScintillaWX::ScrollText(int linesToMove) {
int dy = vs.lineHeight * (linesToMove);
sci->ScrollWindow(0, dy);
- sci->Update();
+// sci->Update(); //causes slow-down on GTK+ systems (Linux)
}
void ScintillaWX::SetVerticalScrollPos() {
--- End code ---
I don't know if the missing Update will create artifacts? I didn't see any issues. (Maybe on windows? -- I did not test)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version