Skip to content

Wayland Native Support #1

Open
Open

Description

@hmpthcs

Thank you very much for posting this repository.

It's been on my 'would be nice, but don't have time' list for years. Glad to see you've got it working!

I recognize this may be intended as a proof of concept project; however, was hoping to run this in a native Wayland environment. Unfortunately, though latency looks good in your vid, TK doesn't appear to support Wayland.

What steps would be needed to integrate an alternative canvas that can run on Wayland? Happy to test and/or get some work started if you might have some tips on where to start bzw. the python script

Activity

  1. s12wu commented on Dec 6, 2024

    @s12wu
    Owner

    Well, thanks for your interest! To be honest, I've never used Wayland before, and sooner or later switched all my systems to X11 (nvidia drivers, xfce, forced hdmi resolution in xorg.conf, ...) because as a user I could never be bothered by the differences, so this is quite new to me

    The actual canvas is handled by a class Sketchpad, inherited from tk.Canvas in https://github.com/s12wu/OnlineHTR/blob/main/src/data/acquisition.py#L132.

    What it does is draw dots on mouse events and store (x, y, time) tuples into the global_strokes list we later pass to predict()

    global_strokes = [
      [(x, y, t), (x, y, t), (x, y, t), ...], # first stroke between pen down and up
      [(x, y, t), (x, y, t), (x, y, t), ...], # second stroke
      # ...
    ]

    So any canvas widget we can get these coordinates from could be used.

    At the moment the predict() function still gets passed a tkinter text widget (prediction_field) into which it writes the recognized text, but this can easily be removed - it is already returning the text as a string either way.

    inkpad.py obviously needs to be rewritten, but the detection stuff should be just fine.

  2. s12wu commented on Dec 13, 2024

    @s12wu
    Owner

    Just to be sure, a GTK3/4 ui would do the job?

  3. s12wu commented on Dec 28, 2024

    @s12wu
    Owner

    So I tried to recreate the tkinter UI in gtk4: https://github.com/s12wu/inkput/blob/gtk/gtk_ui.py

    Jus the drawing part, no recognition is implemented there.
    However, I couldn't figure out how to make the window stay in the foreground and not get focus, since there is no override redirect that can be used. That makes it unusable, at least under GNOME.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions