Web lists-archives.com

Re: Gnome 3.22 Wayland is eating my chess pieces (unicode chess font)




On Mon, 2017-04-10 at 10:37 +0200, Stefan Salewski wrote:
> Any ideas?

Well, maybe the problem is not the font dimensions, but the window
itself.

The size calculations occur in

https://github.com/ngtk3/nim-chess2/blob/master/board.nim

proc drawIt(cr: cairo.Context; widget: Widget) {.cdecl.} =
  const
    Font = "Sans 64"

  var
    w, h: cint
    width: cint = widget.parentWindow.width
    height = widget.parentWindow.height


I can not remember why size calculation was based on

https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-get-parent-window

I guess I found a hint with Google, it may be related to window
decorations of window managers.

When I set Window size with

window.setDefaultSize(800, 800)

I get different results for wayland and X:

X:
widget.parentWindow.width 800
widget.parentWindow.height 800

Wayland:
widget.parentWindow.width 852
widget.parentWindow.height 894

I am not yet sure that this is the real problem, maybe both results are
just right?

But we need a solution which works for both, X and Wayland.
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list