1
General discussions / Re: Clipboard support on Linux: A few hiccups.
« on: August 26, 2015, 12:27:57 am »
I'm eager to see how ye are going to implement this with no hidden window && no hidden thread.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Earlier in the discussion, a global list of user windows (as it already exists on Linux) was mentioned... The clipboard might also make use of that.
The reason for hiding the window is to make the API simpler and cleaner. I'd prefer an extra window argument to all the clutter that you add to the Clipboard classI don't know what you mean by clutter
Why? You could create that on first use. Problem solvedCreating and destroying the hidden stuff in accordance to the need helps a lot, but the hidden stuff still is just what virtually all user applications would have anyway, and therefore redundant. But the only way to get rid of that redundance is to allow the user point a window to use.
class Clipboard
{
static data get(window?);
static void set(data, window);
}
I've been testing exclusively with the SFML-2.1 MinGW download version for a while, so recent GitHub changes shouldn't be an issue.
If SetClipboardData succeeds, the system owns the object identified by the hMem parameter.
And the API does not make sense from a semantic standpoint, users not being familiar with X11 won't expect the clipboard to be associated with a window. Other than Juhani, I don't think we should prematurely exclude applications that access the clipboard but not the window. Why is a console application not allowed to use a clipboard?
Additionally, clipboard-related functionality is not gathered in one place if we add functions to the window. What if we decide to extend the clipboard API in the future, e.g. by supporting more MIME types? We would then have to further bloat sf::Window.