hezral / clips

Multi format clipboard manager with extra features
GNU General Public License v3.0
39 stars 1 forks source link

[flatpak] App doesn't show window when launched #1

Closed hanaral closed 3 years ago

hanaral commented 3 years ago

Maybe I'm missing something, but I can't get it run outside the commandline

hezral commented 3 years ago

what does it show when u run it witb flatpak run com.github.hezral.clips

hezral commented 3 years ago

by the way, this repo is just temporary, i'm moving back to the original one

hanaral commented 3 years ago

@hezral

han@elementary-os:~/Documents/clips-master$ flatpak run com.github.hezral.clips 
Gtk-Message: 12:51:15.141: Failed to load module "pantheon-filechooser-module"
2021-05-22 12:51:15.213228 startup
Gtk-Message: 12:51:15.241: Failed to load module "canberra-gtk-module"
2021-05-22 12:51:15.248659 open_db
Found ClipsDB [(0, 'main', '/home/han/.var/app/com.github.hezral.clips/cache/com.github.hezral.clips/com.github.hezral.clips.db')]
^C

Here is the terminal output I have no idea why it isn't opening, is there a keybind or something?

hezral commented 3 years ago

that's odd.. can you try to uninstall and remove the /home/han/.var/app/com.github.hezral.clips/ directory. Also, pull the latest from the repo, i added some directory checks so it doesn't fail if the dir didn't exist.

you're using io.elementary.Platform for the runtime? i actually haven't tested that yet.

and it should show the main window on first-run so, nothing showing is definitely wrong.

hanaral commented 3 years ago

It's still not running, even after:

hezral commented 3 years ago

well i'm stumped :)

  1. can you try installing it natively using meson. i've just tested it works as well.
  2. which OS are you trying this on?
  3. run it again from the desktop launcher after you run it from command line (probably same but just want to see what happens)
hezral commented 3 years ago

i just built it on Hera and it's working too.

hanaral commented 3 years ago

@hezral Before I test any of this, could you just tell me if there is a possibility that there are some required folders, because I have my home dir. locality set to japanese

hanaral commented 3 years ago

Native build does nothing too:

han@elementary-os:~/Documents/clips/build$ com.github.hezral.clips 
Gtk-Message: 17:20:39.583: Failed to load module "pantheon-filechooser-module"
2021-05-23 17:20:39.637665 startup
2021-05-23 17:20:39.670756 open_db
Found ClipsDB [(0, 'main', '/home/han/.cache/com.github.hezral.clips/com.github.hezral.clips.db')]

I'm using Odin Early Access

hezral commented 3 years ago

it doesn't require any additional folders other that the cache folder for read-write. others are read-only. can you share how you've set the locality to japanese? maybe i can try to reproduce that.

if there are errors, it would show on the command line. so nothing after u launch it again from the desktop launcher right?

i'm on Odin Early Access too.

hezral commented 3 years ago

Ok, i just spin up a new Odin fresh install, and it works as well for flatpak. it might be something with your setup. Are you able to try it on a fresh Odin install with no customization? worth to note, i am running this on the raspberry pi build, and had to build the flatpak-platform locally. But as i tested on Hera, i used the io.elementary.Platform and Sdk from the elementary flatpak repo. So, i don't think its because of that.

Hera flatpak: OK native: OK

Odin Early Access: flatpak: OK native: OK

hanaral commented 3 years ago

@hezral running both native and the flatpak version does something interesting with --debug enabled and I try to copy something:

han@elementary-os:~/Documents$ flatpak run com.github.hezral.clips --debug
Gtk-Message: 08:34:04.555: Failed to load module "pantheon-filechooser-module"
running in debug mode
waiting for clipboard event
Traceback (most recent call last):
  File "/app/share/com.github.hezral.clips/clips/clips_supported.py", line 100, in get_clipboard_contents
    print("Active App:", utils.get_active_app_window())
  File "/app/share/com.github.hezral.clips/clips/utils.py", line 243, in get_active_app_window
    all_apps = get_all_apps()
  File "/app/share/com.github.hezral.clips/clips/utils.py", line 195, in get_all_apps
    with open(desktop_file_path) as file:
UnboundLocalError: local variable 'desktop_file_path' referenced before assignment
hezral commented 3 years ago

that's for the debugging clipboard events but it does point out that the utils couldn't read one of the directories.

can you check if any of these folders are missing

/usr/local/share/applications /var/lib/snapd/desktop /var/lib/flatpak/exports/share/applications ~/.local/share/flatpak/exports/share/applications ~/.local/share/applications

i just made a change on utils.py. can you pull and run the same debug and share me the output?

still doesn't make sense why the initial window won't load though..

hezral commented 3 years ago

@hanaral also any chance you can try on a fresh install, no customization?

hanaral commented 3 years ago

@hezral Yup, just did it and it's fixed. I really hope this was a one off thing because of something in the Early Access (for elementary's sake, I wouldn't want this to be a common issue) Anyway great work with the app, I'll open some issues for other stuff now that I can test I'll close this, but it could be reopened if it wasn't a one-time thing

hezral commented 3 years ago

thanks, i'm stil curious what the issue was. Can you share how you configured locality for japanese? I can read/write japanese too so i can test it

hanaral commented 3 years ago

I changed it via the locality plug, I mean locality as in the system's own underlying language for directory names and other stuff that setting your user's language doesn't change. It's messed with apps like zoom in the past which even as a flatpak are hardcoded to dump stuff in ~/Documents even if you instead only have a folder called ~/ドキュメント

hezral commented 3 years ago

that might be it. i'll need to relook at this. the paths that Clips reads are all system paths with user cache path which i see is not in japanese.

btw, tested by setting language to Japanese and it worked .

image

hanaral commented 3 years ago

Very odd indeed. The issue persisted no matter whether it was native or flatpak - so I still think it must've been something in my home dir (I probably should've seen whether it was the same on a new user)