Author Topic: Auto completion list is invisible in some situations  (Read 4864 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11134
    • Travis build status
Auto completion list is invisible in some situations
« on: May 21, 2014, 03:44:55 pm »
Very annoying issue if I'm typing at the bottom of the editor window and the Logs'n'others is hidden.

Steps to reproduce:
1. Maximize C::B
2. Hide Logs'n'others
3. Open a text file that can fill the full screen
4. Go to the last line
5. Show the autocompletion list

The result is that the autocompletion list is displayed below my cursor and it is almost fully invisible.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Teybeo

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Auto completion list is invisible in some situations
« Reply #1 on: July 30, 2014, 12:10:41 am »
+1 very annoying

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Auto completion list is invisible in some situations
« Reply #2 on: July 30, 2014, 03:39:38 am »
This is caused by a screen vs. client coordinate issue.  The following patches this (but might break other assumptions? ... needs more testing).
Code: [Select]
diff --git a/src/sdk/wxscintilla/src/PlatWX.cpp b/src/sdk/wxscintilla/src/PlatWX.cpp
index ac8d839..a9f4a8a 100644
--- a/src/sdk/wxscintilla/src/PlatWX.cpp
+++ b/src/sdk/wxscintilla/src/PlatWX.cpp
@@ -761,7 +761,7 @@ bool Window::HasFocus()
 PRectangle Window::GetPosition()
 {
     if (! wid) return PRectangle();
-    wxRect rc(GETWIN(wid)->GetPosition(), GETWIN(wid)->GetSize());
+    wxRect rc(GETWIN(wid)->GetScreenPosition(), GETWIN(wid)->GetSize());
     return PRectangleFromwxRect(rc);
 }
 
diff --git a/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx b/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx
index cf87a50..9890fbd 100644
--- a/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx
+++ b/src/sdk/wxscintilla/src/scintilla/src/ScintillaBase.cxx
@@ -300,7 +300,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
        // Make an allowance for large strings in list
        rcList.left = pt.x - ac.lb->CaretFromEdge();
        rcList.right = rcList.left + widthLB;
-       if (((pt.y + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) &&  // Wont fit below.
+       if (((pt.y + wMain.GetPosition().top + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) &&  // Wont fit below.
                ((pt.y + vs.lineHeight / 2) >= (rcPopupBounds.bottom + rcPopupBounds.top) / 2)) { // and there is more room above.
                rcList.top = pt.y - heightAlloced;
        } else {

@devs: From what I can tell, Window::GetPosition() currently has an incorrect implementation, and will (always?) return top left corner as (0, 0).  Thoughts?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11134
    • Travis build status
Re: Auto completion list is invisible in some situations
« Reply #3 on: July 30, 2014, 09:30:16 am »
Probably you should ask in the wx-dev mailing list, there you'll get better advice, also you can contribute this patch to the wx project.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11134
    • Travis build status
Re: Auto completion list is invisible in some situations
« Reply #4 on: April 01, 2018, 07:33:00 pm »
Fixed in rev 11360...
The call tip has also been affected by this problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]