Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple clipboard from fyne.Window #4418

Closed
2 tasks done
Jacalz opened this issue Nov 23, 2023 · 9 comments · Fixed by #5121
Closed
2 tasks done

Decouple clipboard from fyne.Window #4418

Jacalz opened this issue Nov 23, 2023 · 9 comments · Fixed by #5121
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers refactor Issues related to refactoring code.

Comments

@Jacalz
Copy link
Member

Jacalz commented Nov 23, 2023

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

The clipboard in GLFW was previously tied to the window. This is no longer the case so I think it seems strange to have a window.Clipboard() method when clipboards generally are per app or per system and not per window.

See #4417 for step one.

Is it possible to construct a solution with the existing API?

Yeah. We can move the clipboard struct anywhere we'd like.

Describe the solution you'd like to see.

Add a app.Clipboard() method and deprecate the one on the window.

@Jacalz Jacalz added enhancement New feature or request refactor Issues related to refactoring code. good first issue Good for newcomers labels Nov 23, 2023
@Jacalz Jacalz mentioned this issue Nov 23, 2023
3 tasks
@Jacalz Jacalz changed the title Decouple clipboard from Window struct Decouple clipboard from fyne.Window Nov 23, 2023
@andydotxyz
Copy link
Member

This will make some system tray people happy as well, because we can then use clipboard without having any windows created.

@Jacalz Jacalz self-assigned this Nov 27, 2023
@Jacalz
Copy link
Member Author

Jacalz commented Nov 27, 2023

Cool. I'll assign myself and look into implementing this

@dweymouth dweymouth added this to the "F" release, Late 2024 milestone Jul 18, 2024
@pierrec
Copy link

pierrec commented Sep 7, 2024

What is the status of this issue? I had a quick glance and it seems that what is left is:

  • add the Clipboard() method to fyne.App
  • expose the clipboard struct from internal/glfw and internal/mobile
  • add the Clipboard() method to fyne.driver to expsoe that struct?
  • implement the Clipboard method on app/fyneApp
  • deprecate fyne.Window.Clipboard (as of 2.6?)

This seems too simple to be true :)

@andydotxyz
Copy link
Member

That sounds about right except I don't think there is any need to expose new structs to do this...

pierrec pushed a commit to pierrec/fyne that referenced this issue Sep 8, 2024
NB. getting a lot of errors when running go test ./..., unrelated
to this change. Will investigate some of them as they relate to the
locale, others I have no idea.
pierrec pushed a commit to pierrec/fyne that referenced this issue Sep 8, 2024
pierrec pushed a commit to pierrec/fyne that referenced this issue Sep 8, 2024
pierrec pushed a commit to pierrec/fyne that referenced this issue Sep 9, 2024
@Jacalz
Copy link
Member Author

Jacalz commented Oct 2, 2024

I wonder if step two here should be to deprecate the clipboard field from shortcuts? Is there any point in passing a copy of the clipboard with each shortcut if it can be looked up easily from the app?

@andydotxyz
Copy link
Member

It can be deprecated yes, but we will have to keep populating those deprecated fields until v3 because they were filled from inside the toolkit.

@Jacalz
Copy link
Member Author

Jacalz commented Oct 3, 2024

Absolutely, I'm aware of that :)

@Jacalz
Copy link
Member Author

Jacalz commented Oct 4, 2024

I wonder if this should stay open until those fields are deprecated or if that should be a different ticket?

@andydotxyz
Copy link
Member

Given that there is no harm in using them still I don't think this has to stay open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers refactor Issues related to refactoring code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants