Menu

#2021 Popup menus programmed in LUA scripts not correctly displayed on Linux GTK

Bug
closed
nobody
4
2023-11-04
2018-07-11
No

Hello,
I'm using SciTE 4.1.0 on Linux Fedora-28 GNOME (GTK 3.22.30).

I developed some LUA scripts using popup menus (via OnUserListSelection function) and I've some problems with, because, depending of the editor position on screen, popup menus are not always completely displayed. SciTE doesn't perform adjustment on the position of popup menus to display them completely.

I searched in SciTE 4.1.0 sources and seen the problem comes from the function Window:SetPositionRelative in scintilla/gtk/PlatGTK.cxx source file. This function is called to display popup menus. In this function, ox and oy variables (position of the popup menu) are compared to the screen dimension ("to fit into screen" as sayed in a comment) but these comparisons are always ineffective because ox and oy are relative to the SciTE window, not to the screen. To fit correctely the popup menu into screen, you have to compare its absolute position with the screen dimension, and moreover you have to take into account the size and position of the menu bar of GNOME itself (at top of screen by default).

Best Regards.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2018-07-11

    It works better on Ubuntu 18.04 so this may be due to the different way that coordinates work on Wayland versus X.org.

     
  • Philippe Berthault

    I tried to launch GNOME session on Xorg and the problem disappeared on Xorg.
    So, you're right, the problem comes from Wayland.
    Consequently, you can close this ticket and perhaps add a warning about Wayland on SciTE web site.
    Regards.

     
  • Neil Hodgson

    Neil Hodgson - 2018-07-12

    The issue should stay open so that it can be found by others and hopefully fixed. The menu bar can be taken account of with gdk_monitor_get_workarea but I'm pretty lost on how to use that since Wayland appears to not want application code to know about global coordinates. There is already some Wayland-specific code in Scintilla.

    Its unlikely I'll work on this soon myself.

     
  • Neil Hodgson

    Neil Hodgson - 2018-07-12
    • labels: scintilla --> scintilla, wayland, gtk
    • Priority: 5 --> 4
     
  • Neil Hodgson

    Neil Hodgson - 2023-10-27

    Related issues like [#2296] have been fixed and UserListShow appears to work in simple cases.

    function ShowUserList()
        editor.AutoCSeparator = string.byte(" ")
        editor:UserListShow(1, "cat dog frog")
    end
    

    If there are further problems with particular situations, they should be described. Otherwise, this issue will be closed.

     

    Related

    Bugs: #2296

  • Neil Hodgson

    Neil Hodgson - 2023-11-04
    • status: open --> closed
     

Log in to post a comment.