-
Notifications
You must be signed in to change notification settings - Fork 445
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
Support Mac OS X platforms #26
Comments
Would love to see someone take this on, as I'll probably be switching to OSX + Linux soon. If no one takes it on before then (and I do end up switching), I'll do it :). Not sure I could work properly without CopyQ anymore! |
If you (or someone) can implement the features that would be great. Everything is ready for implementation in I will extend the platform interface class as needed (e.g. we may now need something different than QSystemTray to show tray icon). |
I've started looking into this on my mac-support branch. So far it builds, but it freezes after it launches (stuck in The tray icon actually shows up nicely. I can even get the menu to show up if I pause and restart the application in the debugger. |
Great work! Glad to hear that the tray works, unlike the mean Unity on Ubuntu. You can comment out line CopyQ/src/app/clipboardserver.cpp Line 103 in f0cf81b
|
Yeah, that fixes it. I actually came across that just before you replied! Any ideas how to fix that? Have you previously run into issues with the QLocalServer to make you think that's what was broken? |
It's hard to say. I was fixing it some time ago because it misbehaved on Windows. Actually this is possibly what makes it unusable on OS/2 platform too (though CopyQ v1.6.3 worked well). Can you post backtrace where it is stuck? One place where it can get stuck is CopyQ/src/app/remoteprocess.cpp Line 71 in f0cf81b
CopyQ/src/app/clipboardmonitor.cpp Line 264 in f0cf81b
So I guess QLocalSocket or QLocalServer is incorrectly set up. |
I don't have my Mac with me at the moment, but the backtrace doesn't actually show any code from CopyQ after App::exec(). It just shows a QLocalServer doing an "accept" on a socket, which blocks the Qt event loop. That makes me think it's not in fact a blocking call somewhere inside CopyQ, but I'm not really sure what would cause it yet. I can post more details later. |
I got it working. Using |
Great job! I'll keep in mind that using |
Just a quick update on this. I'm still working on it, and so far there are 1579 modifications. It's a bit bigger than I expected! Besides implementing the macplatform methods, here are a few of the unexpected issues I've run into so far:
The code on my branch builds and seems to work well (if using qmake), but there are some pretty serious limitations (OS X 10.9 Mavericks with Qt 5.2). |
OK, that's great! I was checking commits in your branch a bit. Overall it looks good; I could start adding some comments now or wait for pull request. What do you think? Do you know any CI service that lets us build for OS X (after a commit or sending source code package)? |
I haven't started a pull request yet, because the branch is certainly not ready for merging! At the moment, almost all tests are failing, but I haven't yet been able to look into that (bigger issues have kept coming up). If it would make it easier, I could start a pull request so that we can have an easier conversation about the code, we just need to be careful not to actually merge it. What do you think? As for CI services, it looks like Travis CI has an OS X build environment. |
Yes, you can start pull request to Glad to see Travis supports OS X. |
@hluk I've got a few questions which have come up working on this:
I'm continuing to make progress on various aspects of the OS X support, and hope to have it to an alpha/beta ready state soon! |
ad 1. I'm open to any ideas concerning build systems. ad 2. On Linux X11, an application holds clipboard data and provides them on request. So it can take quiet long time to retrieve clipboard if the clipboard provider is slow or doesn't respond at all. In the latter case you'll get either NULL or empty clipboard data with Qt (not sure which one is it). Additionally you have to retrieve data in GUI thread. So it's better if there is separate process for handling clipboard which can take longer time to respond or even crash. ad 3. That's other peculiarity of X11. If you select a text it gets stored in primary selection (instead of regular clipboard). But this can happen immediately while selecting the text depending on application's behavior. So instead of creating item in CopyQ when each character or so is selected it tries to check if the text of the first item in list matches beginning or end of current selection. If it matches the first item just replaced without creating a new item. This works with regular clipboard too. If this code doesn't work well or is unexpected, it should be disabled if the copied text doesn't come from X11 selection. What do you think? |
I removed Also see commit ea39768. If anything goes wrong when raising/focusing window (e.g. the window doesn't exist) the content must not be pasted. |
Thanks @hluk. The OS X code already checks to see if the window successfully raised before pasting. I'll remove the I've been looking into the test failures, and I've found a few of the sources, and I'd like to get some feedback from you on some of them:
|
ad 1. Thanks for pointing out the location in code. That's quiet new code. It's there because otherwise if you run more CopyQ sessions they can fight over clipboard when trying to synchronize X11 selection and clipboard or they can start changing clipboard in response to user commands. I didn't have time to check why one test is failing I always assumed that the interval after setting clipboard is too small. I'll fix this. ad 2. Yes, you can add ad 3. Backspace in main window resets and hides search entry field if it's not focused. I've never noticed it but there probably should be condition I guess you can remove the I removed the restriction for Backspace key in shortcut dialog. So now you can override backspace and remove shortcut with dialog button (910760d). ad 4. Damn. So |
Commit 2ac4737 should fix the failing tests. |
From reading the docs, it looks to me like using |
Lots more work under a new PR. The remaining work on this is now:
The first item there (weirdness from Finder), brings up another question for you. On OS X, when you copy a file in Finder, the clipboard/pasteboard gets:
My current thought on how to deal with this is that if the clipboard contains data for the mime type |
Finished the first two items |
Format display priority is strictly given by the order of item plugins in Preferences, Items tab. Each plugin checks if there is format it can display (creates ItemWidget). I don't think that any icon is copied on Windows (Explorer) and Linux (Nautilus, Nemo ...) -- though other file manager can copy icons or anything else with URI lists. I was thinking of creating a plugin for URI and this is a good reason to do so (#137). |
On the |
I think with that last merge, all that's left for OS X support is to get some testing, and figure out what else is broken that I don't use. Should we close this issue, and add new issues for anything that's found broken? |
Alright. Thanks for bringing the app to OS X! |
Although code is supposed to run on OS X there is no developer for this platform.
TODO
src/platform/mac/macplatform.cmake
andsrc/platform/mac/macplatform.pri
.PlatformNativeInterface
insrc/platform/mac/macplatform.cpp
.Some window management functions are available in libqxt:
https://bitbucket.org/libqxt/libqxt/src/master/src/widgets/mac/qxtwindowsystem_mac.cpp?at=master
The text was updated successfully, but these errors were encountered: