| Summary: | [GTK3] org_eclipse_swt_widgets_Text.test_getTopIndex fails | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Eric Williams <ericwill> |
| Component: | SWT | Assignee: | Eric Williams <ericwill> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | akurtakov, arunkumar.thondapu, daniel_megert, Lars.Vogel, lufimtse, markus.kell.r, sravankumarl |
| Version: | 4.6 | Flags: | akurtakov:
review+
arunkumar.thondapu: review+ sravankumarl: review+ |
| Target Milestone: | 4.6 RC3 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://git.eclipse.org/r/70980 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=49807d830c551e52f478d4ccc4d6fa3f481d1f62 https://git.eclipse.org/r/71140 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=cf344d18125866944c714112418407308ab5e2cf https://git.eclipse.org/r/73329 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=83f68458d1ae8ca986e87c6cf49dcb5c4bf9ba65 |
||
| Whiteboard: | |||
| Bug Depends on: | 461354 | ||
| Bug Blocks: | |||
|
Description
Eric Williams
The root cause of this problem is Bug 461354. We need to develop a workaround for that problem to fix this issue. I raised a GTK bug for this. But GTK team came bask saying that that is the expected behavior. Please review the bug 461354 for this. This has a GTK only reproducible scenario. (In reply to Sravan Kumar Lakkimsetti from comment #1) > The root cause of this problem is Bug 461354. We need to develop a > workaround for that problem to fix this issue. > > I raised a GTK bug for this. But GTK team came bask saying that that is the > expected behavior. > > Please review the bug 461354 for this. This has a GTK only reproducible > scenario. Thanks Sravan, I was unaware of that bug. I'll add this one as a blocker. (In reply to Sravan Kumar Lakkimsetti from comment #1) > The root cause of this problem is Bug 461354. We need to develop a > workaround for that problem to fix this issue. > > I raised a GTK bug for this. But GTK team came bask saying that that is the > expected behavior. > > Please review the bug 461354 for this. This has a GTK only reproducible > scenario. So I've made some progress on this bug (for Text at least). GtkTextView has something called a GtkTextMark, which is ideal for preserving text position as it operates similar to an "invisible cursor". More importantly it updates properly and does not delay due to line validation like a GtkTextIter does. Basically in Text we can specify a GtkTextMark and set it to the correct index every time setTopIndex() is called. When getTopIndex() is called, we can convert that GtkTextMark into a GtkTextIter and retrieve the proper line position using gtk_text_iter_get_line(). I'll upload a patch shortly for this bug. As for bug 461354, I made some progress for List widgets but it's more of a workaround. New Gerrit change created: https://git.eclipse.org/r/70980 *** Bug 485681 has been marked as a duplicate of this bug. *** Gerrit change https://git.eclipse.org/r/70980 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=49807d830c551e52f478d4ccc4d6fa3f481d1f62 In master now New Gerrit change created: https://git.eclipse.org/r/71140 Gerrit change https://git.eclipse.org/r/71140 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=cf344d18125866944c714112418407308ab5e2cf (In reply to Eclipse Genie from comment #9) > Gerrit change https://git.eclipse.org/r/71140 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=cf344d18125866944c714112418407308ab5e2cf I just noticed that I didn't have the /*int*/ tags in OS.java for 32-bit stuff. Fixed that up and merged it. Re-opening as there is a regression. There is a case where getTopIndex() is called without first calling setTopIndex(), and the user *has not* done any scrolling. This causes a native GTK crash. The regression can be reproduced using Snippet243. I have a patch in the works. New Gerrit change created: https://git.eclipse.org/r/73329 (In reply to Eclipse Genie from comment #12) > New Gerrit change created: https://git.eclipse.org/r/73329 This patch fixes the issue. (In reply to Eric Williams from comment #13) > (In reply to Eclipse Genie from comment #12) > > New Gerrit change created: https://git.eclipse.org/r/73329 > > This patch fixes the issue. Patch looks good, +1 from me. Good catch. +1 from me. Gerrit change https://git.eclipse.org/r/73329 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=83f68458d1ae8ca986e87c6cf49dcb5c4bf9ba65 Merged to master *** Bug 494565 has been marked as a duplicate of this bug. *** Bug 494565 is not a dup. > long /*int*/ indexMark = 0; In the future, please use correct variable names (topIndexMark) and avoid redundant initializations (" = 0"). (In reply to Markus Keller from comment #19) > and avoid redundant initializations (" = 0"). I was told to add this during the gerrit review. Sorry, that review comment was wrong. Sravan, please read http://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.12.5 . There are no uninitialized variables in Java. |