mirror of
https://github.com/brl/mutter.git
synced 2025-07-03 09:43:18 +00:00
core: Add clipboard manager
This is a simple clipboard manager implementation on top of MetaSelection. It will inspect the clipboard content for UTF-8 text and image data whenever any other selection source claims ownership, and claim it for itself whenever the clipboard goes unowned. The stored text has a maximum size of 4MB and images 200MB, to prevent the compositor from allocating indefinite amounts of memory. This is not quite a X11 clipboard manager, but also works there. https://gitlab.gnome.org/GNOME/mutter/merge_requests/320
This commit is contained in:
@ -57,6 +57,7 @@
|
||||
#include "core/frame.h"
|
||||
#include "core/keybindings-private.h"
|
||||
#include "core/main-private.h"
|
||||
#include "core/meta-clipboard-manager.h"
|
||||
#include "core/meta-workspace-manager-private.h"
|
||||
#include "core/util-private.h"
|
||||
#include "core/window-private.h"
|
||||
@ -725,6 +726,7 @@ meta_display_open (void)
|
||||
display->bell = meta_bell_new (display);
|
||||
|
||||
display->selection = meta_selection_new (display);
|
||||
meta_clipboard_manager_init (display);
|
||||
|
||||
if (meta_should_autostart_x11_display ())
|
||||
{
|
||||
@ -965,6 +967,8 @@ meta_display_close (MetaDisplay *display,
|
||||
g_clear_object (&display->workspace_manager);
|
||||
g_clear_object (&display->sound_player);
|
||||
|
||||
meta_clipboard_manager_shutdown (display);
|
||||
|
||||
g_object_unref (display);
|
||||
the_display = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user