padgettr / rfm

Simple file manager for dwm
Other
11 stars 2 forks source link

issue when adding Link option besides copy and move in drag and drop #2

Open guyuming76 opened 1 year ago

guyuming76 commented 1 year ago

i forked your repository and tried to add hardlink option in drag and drop, it works somehow, but i do not know how to make the src_actions returned by gtk_drag_context_get_actions to contain GDK_ACTION_LINK

https://gitee.com/guyuming76/rfm/commit/b99f84e66570cb981a247fbb97479959e5650e3a

20221008_14h50m04s_grim

padgettr commented 1 year ago

Hello, I'm sorry I can't see your code, it asks me to login. But assuming you have added a menu item for linking and associated code, I think you will just need to update

define DND_ACTION_MASK GDK_ACTION_ASK|GDK_ACTION_COPY|GDK_ACTION_MOVE

in rfm.c to include GDK_ACTION_LINK? In any case, the menu should appear (those masks are only used to allow menu items - we basically ignore them and always show the menu) and if you delete the line setsensitive for your new item it should work just for testing?


From: guyuming @.> Sent: 08 October 2022 08:41 To: padgettr/rfm @.> Cc: Subscribed @.***> Subject: [padgettr/rfm] issue when adding Link option besides copy and move in drag and drop (Issue #2)

i tried to add hardlink option in drag and drop, it works somehow, but i do not know how to make the src_actions returned by gtk_drag_context_get_actions to contain GDK_ACTION_LINK

https://gitee.com/guyuming76/rfm/commit/b99f84e66570cb981a247fbb97479959e5650e3a

[20221008_14h50m04s_grim]https://user-images.githubusercontent.com/12045548/194698514-e12b4cbe-f7b1-42da-a735-1664711eac2e.png

— Reply to this email directly, view it on GitHubhttps://github.com/padgettr/rfm/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB25FQZLG7AR72Z6CKCAN6DWCEXTXANCNFSM6AAAAAARAFHVRM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

guyuming76 commented 1 year ago

@padgettr ,thanks for reply! I had modified DND_ACTION_MASK, but it does not affect the value of src_actions for me. And the Link menu item i added is disabled due to not set sensitive to True. If i set sensitive to True, the menu item works.

My url asks for login, but it support login with github account(oauth authentication). i cannot find option to make it anonymous.

padgettr commented 1 year ago

Hi, it works OK for me if I add it to DND_ACTION_MASK. Don't forget it is the source sending those actions, not the receiver. So to test you

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: guyuming @.> Sent: Sunday, October 9, 2022 11:10:28 PM To: padgettr/rfm @.> Cc: Dr Rodney Padgett @.>; Mention @.> Subject: Re: [padgettr/rfm] issue when adding Link option besides copy and move in drag and drop (Issue #2)

@padgettrhttps://github.com/padgettr ,thanks for reply! I had modified DND_ACTION_MASK, but it does not affect the value of src_actions for me. And the Link menu item i added is disabled due to not set sensitive to True. If i set sensitive to True, the menu item works.

My url asks for login, but it support login with github account. i cannot find option to make it anonymous.

— Reply to this email directly, view it on GitHubhttps://github.com/padgettr/rfm/issues/2#issuecomment-1272638454, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB25FQ2YX6IDC2W7MPMGIJTWCM7FJANCNFSM6AAAAAARAFHVRM. You are receiving this because you were mentioned.Message ID: @.***>

padgettr commented 1 year ago

Sorry trying to type on a phone! To test you need to run 2 instances of the new rfm with action link defined and drag and drop between them. If you drag from another source which doesn't define the new link, e.g. an old version of rfm, it will not include the action. It is the source that defines those gdk actions, not the destination. Hope that makes sense. Cheers, Rod.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: guyuming @.> Sent: Sunday, October 9, 2022 11:10:28 PM To: padgettr/rfm @.> Cc: Dr Rodney Padgett @.>; Mention @.> Subject: Re: [padgettr/rfm] issue when adding Link option besides copy and move in drag and drop (Issue #2)

@padgettrhttps://github.com/padgettr ,thanks for reply! I had modified DND_ACTION_MASK, but it does not affect the value of src_actions for me. And the Link menu item i added is disabled due to not set sensitive to True. If i set sensitive to True, the menu item works.

My url asks for login, but it support login with github account. i cannot find option to make it anonymous.

— Reply to this email directly, view it on GitHubhttps://github.com/padgettr/rfm/issues/2#issuecomment-1272638454, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB25FQ2YX6IDC2W7MPMGIJTWCM7FJANCNFSM6AAAAAARAFHVRM. You are receiving this because you were mentioned.Message ID: @.***>

guyuming76 commented 1 year ago

I have just tried my changes based on your latest version, but the src_action still does not contain action_link although the DND_ACTION_MASK contains it.

this is how i set the drag source: https://gitee.com/guyuming76/rfm/commit/d50798081dfb8f64712f4264419e95d54a2d53d2

20221108_15h38m01s_grim

guyuming76 commented 1 year ago

two new findings:

  1. i tried on an ubuntu system, the returned src_action contains GDK_ACTION_LINK as expected. My problematic environment is gentoo.
  2. on the ubuntu system print *context also returns
padgettr commented 1 year ago

I'm using Arch linux with dwm (x11) what window manager were you using on gentoo?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: guyuming @.> Sent: Wednesday, November 9, 2022 1:01:02 PM To: padgettr/rfm @.> Cc: Dr Rodney Padgett @.>; Mention @.> Subject: Re: [padgettr/rfm] issue when adding Link option besides copy and move in drag and drop (Issue #2)

two new findings:

  1. i tried on an ubuntu system, the returned src_action contains GDK_ACTION_LINK as expected. My problematic environment is gentoo.
  2. on the ubuntu system print *context also returns

— Reply to this email directly, view it on GitHubhttps://github.com/padgettr/rfm/issues/2#issuecomment-1308715632, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB25FQYGHNTPXFSFOHDZZM3WHOOA5ANCNFSM6AAAAAARAFHVRM. You are receiving this because you were mentioned.Message ID: @.***>

guyuming76 commented 1 year ago

I'm using Arch linux with dwm (x11) what window manager were you using on gentoo?

That's reminds me. I use DWL(wayland based on wlroots, https://github.com/djpohly/dwl) on gentoo. I just tried DWM on the same system, it works. Seems that wayland (or specific wayland implementation) or xorg makes the difference.

for the "\<incomplete type>" in gdb, turned out it was just i had not installed symbol for gtk+ libs

rfm_err2

padgettr commented 1 year ago

Yes, I should have asked that before! I had problems getting any drag and drop to work on Wayland – didn’t work at all on Weston the reference window manager for Wayland. However, I have used Sway and drag and drop works OK on that, although I don’t know about the link – I don’t use linking much, but when I do need it I tend to just open a terminal in the current directory and use ln. I’m surprised dwl isn’t working as it uses sway wayland libs. I don’t know much about wayland – I did try dwl a while ago, if I get time this weekend I might give it another try! Thanks, Rod.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 10 November 2022 00:40 To: @.> Cc: Dr Rodney @.>; @.> Subject: Re: [padgettr/rfm] issue when adding Link option besides copy and move in drag and drop (Issue #2)

I'm using Arch linux with dwm (x11) what window manager were you using on gentoo?

That's reminds me. I use DWL(wayland based on wlroots, https://github.com/djpohly/dwl) on gentoo. I just tried DWM on the same system, it works. Seems that wayland (or specific wayland implementation) or xorg makes the difference.

for the "" in gdb, turned out it was just i had not installed symbol for gtk+ libs

[rfm_err2]https://user-images.githubusercontent.com/12045548/200971888-0fe03f12-40ae-410e-9832-5dd6025c4cd9.png

— Reply to this email directly, view it on GitHubhttps://github.com/padgettr/rfm/issues/2#issuecomment-1309597584, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB25FQ6F6X23HS3FRASSFUDWHQ77VANCNFSM6AAAAAARAFHVRM. You are receiving this because you were mentioned.Message ID: @.***>