Bugs item #1623208, was opened at 2006-12-28 10:14
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1623208&group_id=2439

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Scintilla
Group: Bug
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Todd Whiteman (twhiteman)
Assigned to: Nobody/Anonymous (nobody)
Summary: GTK+: Editor scrolls text on window resize (v1.71)

Initial Comment:
Scintilla 1.71, can be seen using SciTE.

Example:

1) I have a file with roughly 100 lines. The editor has around 30 lines of 
visible text.
2) Somewhere near the top (say line 10), I then select some text on the this 
line.
3) Now I scroll the editor towards the bottom, to line 90  (Note: The cursor is 
still on line 10 along with the highlighted text).
4) Resizing the window now causes a scroll up, so the cursor/text on line 10 
becomes visible.


Cause:

Editor::LinesOnScreen() function returns a value with more lines than exists 
due to the following problem.

In ScintillaGTK.cxx, the SizeAllocate() function gets called during resizing, 
but it sometimes has inapproriate heights. In my case, the window height was 
400px, yet the call this function sometimes passes through a value of 1024px or 
1px! (Note: my resolution is 1280x1024). This is the value of 
gdk_screen_height(), initially set through SizeRequest().


Solution:

A hacked solution for me was to ignore SizeAllocate() with the default values 
from SizeRequest() or with a height less than 1. Example code below:

void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) {
    if ((allocation->height > 1) && ((allocation->width != 600) || 
(allocation->height != gdk_screen_height()))) {
        ...
    }
}


This does not be the best way, and I'm curious why I see these types of values.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1623208&group_id=2439
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to