poedit icon indicating copy to clipboard operation
poedit copied to clipboard

Hidden font selection button in the preference dialog

Open tvincent2 opened this issue 7 years ago • 23 comments

Hello,

I noticed that in the preference dialog of poedit, the button to set the font for text fields is nearly invisible (see attached capture).

I can reproduce it with poedit 1.8.11 (from Debian Stretch) and 2.0.1 (from experimental). I am using Gnome Shell with a fairly default config, notably default fonts (Cantarell Regular, 11).

Please let me know if I can be of any help to reproduce and fix this bug.

Thanks a lot for your work on poedit! Thomas

tvincent2 avatar Apr 29 '17 13:04 tvincent2

Please actually attach attachments instead of linking to a random site (where they may disappear at any time).

Please provide full reproduction instructions (see this), including such basics as wxGTK and GTK+ versions.

This looks like a wxGTK bug to me, so checking with its latest version seems advisable.

vslavik avatar Apr 29 '17 13:04 vslavik

I am not used to issues in github, sorry. :)

Here is the attachment.

poedit-preference-dialog

tvincent2 avatar Apr 29 '17 13:04 tvincent2

Hello,

My system has wxGTK in version 3.0.2+dfsg-4 and GTK+ in version 2.24.31-2, both installed from Debian Stretch.

I am not sure what other info is needed, so please let me know how I can help. :)

Thomas

tvincent2 avatar May 04 '17 21:05 tvincent2

EDIT: I have the same issue with Ubuntu xenial and a Debian stretch chroot, so the same versions as above

LocutusOfBorg avatar May 05 '17 13:05 LocutusOfBorg

Let's see if anything changes once running against wxGTK 3.0.3 (recently released, so hopefully will be packaged not too long from now too).

vslavik avatar May 06 '17 14:05 vslavik

Hello, I installed a clean machine (stretch based) and I could reproduce only with the poedit from experimental (so, 1.8.11 was fine, 2.0.1 not) I packaged wxGTK 3.0.3 (you can use the debs from here http://debomatic-amd64.debian.net/distribution#experimental/wxwidgets3.0/3.0.3+dfsg-1~exp1/buildlog ) Note, I didn't check for API/ABI breaks, so install it in some controlled environment :)

Testing was the same, still broken the experimental version.

LocutusOfBorg avatar May 08 '17 09:05 LocutusOfBorg

This is how it currently looks using wxGTK 3.0.3:

poedit_2 0 2_prefs_general

Poedit version: 2.0.2 OS: Fedora 26 x86_64 wxGTK3 version: 3.0.3-2 GTK+ version: 3.22.16

When Poedit 2.0.2 is built against current wxGTK 3.1 (master, commit 3105134), the situation is slightly improved - at least the button for the font can be clicked:

poedit_2 0 2_prefs_general_wxgtk_master_2017-07-10

c72578 avatar Jul 07 '17 15:07 c72578

And this is how it looks on Fedora 24 with GTK+ 3.20.9 + wx 3.1/master:

parallels picture 1

If it weren't for reports of the same happening with the old 2.x versions of GTK+, I would assumed something in new GTK+ versions broke it. Like this, I'm just confused and have no idea what's going — @c72578 ruled out non-English UI, old wx and GTK+ 2 as the culprit. I have the same stock Fedora config (font, DPI would appear the same in the screenshots), yet mine is sized correctly.

I guess next step is installing Fedora 26 and hope for the best, because I don't even know what to ask you for or what patches to try :(

(BTW, thanks @c72578 for your Copr packages of Poedit deps, very helpful!)

vslavik avatar Jul 21 '17 09:07 vslavik

because I don't even know what to ask you for or what patches to try

Of course, as I wrote it, some ideas came to kind…

Could you please try to apply this patch and tell me what the terminal output is?

diff --git a/src/prefsdlg.cpp b/src/prefsdlg.cpp
index 699edbdfbc..19f847ee5b 100644
--- a/src/prefsdlg.cpp
+++ b/src/prefsdlg.cpp
@@ -225,6 +225,9 @@ public:
         m_fontText = new wxFontPickerCtrl(this, wxID_ANY);
         m_fontText->SetMinSize(wxSize(PX(120), -1));
 
+        printf("top button size: %d x %d\n", m_fontList->GetSize().x, m_fontList->GetSize().y);
+        printf("bottom button size: %d x %d\n", m_fontText->GetSize().x, m_fontText->GetSize().y);
+
         appearance->Add(m_useFontList, wxSizerFlags().CenterVertical().Left());
         appearance->Add(m_fontList, wxSizerFlags().CenterVertical().Expand());
         appearance->Add(m_useFontText, wxSizerFlags().CenterVertical().Left());

Mine is this:

top button size: 166 x 34
bottom button size: 166 x 34

Afterwards, please try the same with this patch and check if it changes anything (it doesn't here):

diff --git a/src/prefsdlg.cpp b/src/prefsdlg.cpp
index 699edbdfbc..f03b2046fc 100644
--- a/src/prefsdlg.cpp
+++ b/src/prefsdlg.cpp
@@ -220,10 +220,13 @@ public:
 
         m_useFontList = new wxCheckBox(this, wxID_ANY, _("Use custom list font:"));
         m_fontList = new wxFontPickerCtrl(this, wxID_ANY);
-        m_fontList->SetMinSize(wxSize(PX(120), -1));
+        //m_fontList->SetMinSize(wxSize(PX(120), -1));
         m_useFontText = new wxCheckBox(this, wxID_ANY, _("Use custom text fields font:"));
         m_fontText = new wxFontPickerCtrl(this, wxID_ANY);
-        m_fontText->SetMinSize(wxSize(PX(120), -1));
+        //m_fontText->SetMinSize(wxSize(PX(120), -1));
+
+        printf("top button size: %d x %d\n", m_fontList->GetSize().x, m_fontList->GetSize().y);
+        printf("bottom button size: %d x %d\n", m_fontText->GetSize().x, m_fontText->GetSize().y);
 
         appearance->Add(m_useFontList, wxSizerFlags().CenterVertical().Left());
         appearance->Add(m_fontList, wxSizerFlags().CenterVertical().Expand());

TIA!

vslavik avatar Jul 21 '17 09:07 vslavik

first patch: (Debian unstable)

poedit
Gtk-Message: Failed to load module "canberra-gtk-module"
top button size: 110 x 36
bottom button size: 110 x 36

LocutusOfBorg avatar Jul 22 '17 08:07 LocutusOfBorg

nothing changes with the second one :(

LocutusOfBorg avatar Jul 22 '17 08:07 LocutusOfBorg

So much for that theory :( So the buttons do have a reasonable size, yet the layout engine clearly thinks they have very small height (see not only the overlap, but how the checkboxes are packed too tight as well).

Is there enough room on the screen for the window?

What if you try this (hardcodes minimal height)?

diff --git a/src/prefsdlg.cpp b/src/prefsdlg.cpp
index 699edbdfbc..f03b2046fc 100644
--- a/src/prefsdlg.cpp
+++ b/src/prefsdlg.cpp
@@ -220,10 +220,13 @@ public:
 
         m_useFontList = new wxCheckBox(this, wxID_ANY, _("Use custom list font:"));
         m_fontList = new wxFontPickerCtrl(this, wxID_ANY);
-        m_fontList->SetMinSize(wxSize(PX(120), -1));
+        m_fontList->SetMinSize(wxSize(PX(120), 36));
         m_useFontText = new wxCheckBox(this, wxID_ANY, _("Use custom text fields font:"));
         m_fontText = new wxFontPickerCtrl(this, wxID_ANY);
-        m_fontText->SetMinSize(wxSize(PX(120), -1));
+        m_fontText->SetMinSize(wxSize(PX(120), 36));
+
+        printf("top button size: %d x %d\n", m_fontList->GetSize().x, m_fontList->GetSize().y);
+        printf("bottom button size: %d x %d\n", m_fontText->GetSize().x, m_fontText->GetSize().y);
 
         appearance->Add(m_useFontList, wxSizerFlags().CenterVertical().Left());
         appearance->Add(m_fontList, wxSizerFlags().CenterVertical().Expand());

What are your GNOME DPI settings?

vslavik avatar Jul 22 '17 09:07 vslavik

hope this helps :)

$ xdpyinfo 
name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    11903000
X.Org version: 1.19.3
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0x1000007, revert to Parent
number of extensions:    28
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    DRI2
    GLX
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    Present
    RANDR
    RECORD
    RENDER
    SECURITY
    SGI-GLX
    SHAPE
    SYNC
    X-Resource
    XC-MISC
    XFIXES
    XFree86-DGA
    XFree86-VidModeExtension
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1920x987 pixels (508x261 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x281
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store WHEN MAPPED, save-unders NO
  largest cursor:    64x64

...snipped...

screenshot from 2017-07-22 14-06-04

LocutusOfBorg avatar Jul 22 '17 12:07 LocutusOfBorg

hope this helps :)

What about the other two questions? TIA!

vslavik avatar Jul 22 '17 14:07 vslavik

Ah, I'm being slow, the screenshot means that yes, plenty space and no, hardcoding minimal size didn't have an effect either, correct?

vslavik avatar Jul 23 '17 06:07 vslavik

Yep sorry I don't have my laptop right now but yeah that vm has a lot of space

LocutusOfBorg avatar Jul 23 '17 06:07 LocutusOfBorg

And hardcoded patch applies (modulo mistakes from my side)

LocutusOfBorg avatar Jul 23 '17 06:07 LocutusOfBorg

In the meantime I saw, that the problem with the font selection buttons sometimes was there and sometimes not. So I did some further investigations and could observe the following:

  • The problem occurs on my system only, when Poedit is started with a previously maximized main Poedit window.
  • When Poedit is started with a "not maximized" main window, then it depends on the main windows' size, if the problem occurs or not.
  • It seems that the size of the Preferences-General window (and the font selection button problem) is somehow related to the size of the main Poedit window.
  • Here are some examples of Poedit main window sizes (h x v), which work, and which not, on this system:

1280x550 OK ... 1280x581 OK 1280x582 not OK 1200x622 OK 1200x623 not OK 1100x682 OK 1100x683 not OK 1050x716 OK 1050x717 not OK 1051x716 OK 1052x716 not OK

The screen resolution on this system was 1280x800 for above tests, with a maximum possible window size for Poedit of 1280x736 (maximized window) Remark: Poedit window sizes were set using e.g.: xdotool search --onlyvisible --name Poedit windowsize 1280 581

  • When the size of the main window is e.g. 1280x582, which is not OK, then the Poedit window is maximized automatically during the start of Poedit. So, when Poedit is closed and started again, it is started maximized and the problem appears. In case of 1280x581 (OK), the window size stays as it is - no problem.
  • For main window sizes of Poedit, where the problem appears, the following is output to the command line, when opening the Preferences-General window: (poedit:4210): Gtk-WARNING **: Negative content height -9 (allocation 1, extents 5x5) while allocating gadget (node button, owner GtkFontButton)
  • Example screenshots:

OK: poedit_preferences-general_2017-09-06_ok Preferences-General window size: 588x631

NOT OK: poedit_preferences-general_2017-09-06_not_ok Preferences-General window size: 588x594 (lower height, not enough space)

  • System: Poedit version: 2.0.3 OS: Fedora 26 x86_64 wxGTK3 version: 3.0.3-5 GTK+ version: 3.22.19

c72578 avatar Sep 06 '17 12:09 c72578

It seems that the size of the Preferences-General window (and the font selection button problem) is somehow related to the size of the main Poedit window.

It isn't… only position is.

When the size of the main window is e.g. 1280x582, which is not OK, then the Poedit window is maximized automatically during the start of Poedit.

I'm not sure I understand, but if you're saying that the window gets maximized when it shouldn't, this could be the key. The size is nowhere near max usable area of your desktop, right?

vslavik avatar Sep 06 '17 13:09 vslavik

An example, where the size is farer away from the max usable area of my desktop (1280x736) is: 1100x683 for the main window of Poedit. When I close Poedit with this window size and start it again, then - yes - it gets maximized, when it shouldn't.

Detailed infos concerning the window size:

$xdotool search --onlyvisible --name Poedit windowsize 1100 683
$xwininfo
  xwininfo: Window id: 0x360000f "Poedit"

  Absolute upper-left X:  0
  Absolute upper-left Y:  64
  Relative upper-left X:  10
  Relative upper-left Y:  45
  Width: 1100
  Height: 683
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+64  -180+64  -180-53  +0-53
  -geometry 1100x683+-10+19

c72578 avatar Sep 06 '17 13:09 c72578

What I just found out, is that this "maximizing" is coming from the system. Just tested with firefox - same behavior. xdotool search --onlyvisible --name Firefox windowsize 1100 683

  • So, the problem with font selection buttons of Poedit occurs here, when the Poedit main window has been maximized - Poedit closed - Poedit started again (maximized window)

c72578 avatar Sep 06 '17 14:09 c72578

Still can't reproduce :( Neither the bad sizes or maximized Poedit window cause it here.

vslavik avatar Sep 07 '17 13:09 vslavik

In the meantime I could do further investigations on the system here. The behavior as described on 2017-09-06, occurs only under specific circumstances concerning VirtualBox settings, where Fedora 26 is running in my case: 3D acceleration has to be enabled and the Guest Additions (GA) have to be installed. The following combinations of settings have been tested:

  1. 3D enabled, GA installed: difference window/fullscreen
  2. 3D enabled, GA uninstalled: no difference window/fullscreen
  3. 3D disabled, GA uninstalled: no difference window/fullscreen
  4. 3D disabled, GA installed: no difference window/fullscreen

This is how it looks in the cases 2), 3), 4): poedit_2 0 4_prefs_advanced_2017-11-23_fullscreen_poedit_vbox_5 1 30_3d-disabled_ga-inst

Case 1): see 2017-09-06 above

xdpyinfo: 1): xdpyinfo_vbox_5.1.30_3D-enabled_GA-inst.txt Same for 2), 3), 4): xdpyinfo_vbox_5.1.30_3D-disabled_GA-inst.txt

So, there seems to be a relation to graphic "card"/driver somehow

  • System: Poedit version: 2.0.4 OS: Fedora 26 x86_64 wxGTK3 version: 3.0.3-5 GTK+ version: 3.22.21-2 VirtualBox: VirtualBox-5.1.30-118389-Win.exe on Windows 7 64bit host

c72578 avatar Nov 23 '17 14:11 c72578