removed G_BEGIN|END_DECLS. (gnome_settings_module_background_get_type):
2007-05-09 Rodrigo Moya <rodrigo@gnome-db.org> * gnome-settings-background.c: removed G_BEGIN|END_DECLS. (gnome_settings_module_background_get_type): register with correct type. (gnome_settings_module_background_initialize): store the GConfClient we get. (gnome_settings_module_background_start): use the stored GConfClient. * gnome-settings-background.h: removed unneeded file. * gnome-settins-clipboard.c: new file to implement the clipboard manager as a loadable module. Replaces clipboard-manager.[ch]. * gnome-settings-daemon.c: removed old clipboard manager and use the new module-based one. * Makefile.am: added/removed sources. svn path=/trunk/; revision=7584
This commit is contained in:
parent
2ddc183f63
commit
19cba117f3
7 changed files with 34 additions and 1085 deletions
|
@ -1,3 +1,20 @@
|
|||
2007-05-09 Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
|
||||
* gnome-settings-background.c: removed G_BEGIN|END_DECLS.
|
||||
(gnome_settings_module_background_get_type): register with correct type.
|
||||
(gnome_settings_module_background_initialize): store the GConfClient we get.
|
||||
(gnome_settings_module_background_start): use the stored GConfClient.
|
||||
|
||||
* gnome-settings-background.h: removed unneeded file.
|
||||
|
||||
* gnome-settins-clipboard.c: new file to implement the clipboard manager as
|
||||
a loadable module. Replaces clipboard-manager.[ch].
|
||||
|
||||
* gnome-settings-daemon.c: removed old clipboard manager and use the new
|
||||
module-based one.
|
||||
|
||||
* Makefile.am: added/removed sources.
|
||||
|
||||
2007-05-08 Rodrigo Moya <rodrigo@gnome-db.org>
|
||||
|
||||
* gnome-settings-background.c: changed to use the new GnomeSettingsModule
|
||||
|
|
|
@ -16,16 +16,14 @@ INCLUDES= \
|
|||
libexec_PROGRAMS=gnome-settings-daemon
|
||||
|
||||
gnome_settings_daemon_SOURCES = \
|
||||
clipboard-manager.c \
|
||||
clipboard-manager.h \
|
||||
delayed-dialog.c \
|
||||
eggaccelerators.h \
|
||||
eggaccelerators.c \
|
||||
factory.c \
|
||||
gnome-settings-accessibility-keyboard.h \
|
||||
gnome-settings-accessibility-keyboard.c \
|
||||
gnome-settings-background.h \
|
||||
gnome-settings-background.c \
|
||||
gnome-settings-clipboard.c \
|
||||
gnome-settings-daemon.h \
|
||||
gnome-settings-daemon.c \
|
||||
gnome-settings-dbus.c \
|
||||
|
|
|
@ -1,919 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2004 Red Hat, Inc.
|
||||
* Copyright © 2004 Nokia Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Red Hat not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Red Hat makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
|
||||
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Authors: Matthias Clasen, Red Hat, Inc.
|
||||
* Anders Carlsson, Imendio AB
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include "clipboard-manager.h"
|
||||
#include "xutils.h"
|
||||
#include "list.h"
|
||||
|
||||
|
||||
struct _ClipboardManager
|
||||
{
|
||||
Display *display;
|
||||
Window window;
|
||||
Time timestamp;
|
||||
|
||||
ClipboardTerminateFunc terminate;
|
||||
ClipboardWatchFunc watch;
|
||||
void *cb_data;
|
||||
|
||||
ClipboardErrorTrapPushFunc error_trap_push;
|
||||
ClipboardErrorTrapPopFunc error_trap_pop;
|
||||
|
||||
List *contents;
|
||||
List *conversions;
|
||||
|
||||
Window requestor;
|
||||
Atom property;
|
||||
Time time;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char *data;
|
||||
int length;
|
||||
Atom target;
|
||||
Atom type;
|
||||
int format;
|
||||
int refcount;
|
||||
} TargetData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Atom target;
|
||||
TargetData *data;
|
||||
Atom property;
|
||||
Window requestor;
|
||||
int offset;
|
||||
} IncrConversion;
|
||||
|
||||
|
||||
/* We need to use reference counting for the target data, since we may
|
||||
* need to keep the data around after loosing the CLIPBOARD ownership
|
||||
* to complete incremental transfers.
|
||||
*/
|
||||
static TargetData *
|
||||
target_data_ref (TargetData *data)
|
||||
{
|
||||
data->refcount++;
|
||||
return data;
|
||||
}
|
||||
|
||||
static void
|
||||
target_data_unref (TargetData *data)
|
||||
{
|
||||
data->refcount--;
|
||||
if (data->refcount == 0)
|
||||
{
|
||||
free (data->data);
|
||||
free (data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
conversion_free (IncrConversion *rdata)
|
||||
{
|
||||
if (rdata->data)
|
||||
target_data_unref (rdata->data);
|
||||
free (rdata);
|
||||
}
|
||||
|
||||
static void
|
||||
send_selection_notify (ClipboardManager *manager,
|
||||
Bool success)
|
||||
{
|
||||
XSelectionEvent notify;
|
||||
|
||||
notify.type = SelectionNotify;
|
||||
notify.serial = 0;
|
||||
notify.send_event = True;
|
||||
notify.display = manager->display;
|
||||
notify.requestor = manager->requestor;
|
||||
notify.selection = XA_CLIPBOARD_MANAGER;
|
||||
notify.target = XA_SAVE_TARGETS;
|
||||
notify.property = success ? manager->property : None;
|
||||
notify.time = manager->time;
|
||||
|
||||
manager->error_trap_push ();
|
||||
|
||||
XSendEvent (manager->display, manager->requestor,
|
||||
False, NoEventMask, (XEvent *)¬ify);
|
||||
XSync (manager->display, False);
|
||||
|
||||
manager->error_trap_pop ();
|
||||
}
|
||||
|
||||
static void
|
||||
finish_selection_request (ClipboardManager *manager,
|
||||
XEvent *xev,
|
||||
Bool success)
|
||||
{
|
||||
XSelectionEvent notify;
|
||||
|
||||
notify.type = SelectionNotify;
|
||||
notify.serial = 0;
|
||||
notify.send_event = True;
|
||||
notify.display = xev->xselectionrequest.display;
|
||||
notify.requestor = xev->xselectionrequest.requestor;
|
||||
notify.selection = xev->xselectionrequest.selection;
|
||||
notify.target = xev->xselectionrequest.target;
|
||||
notify.property = success ? xev->xselectionrequest.property : None;
|
||||
notify.time = xev->xselectionrequest.time;
|
||||
|
||||
manager->error_trap_push ();
|
||||
|
||||
XSendEvent (xev->xselectionrequest.display,
|
||||
xev->xselectionrequest.requestor,
|
||||
False, NoEventMask, (XEvent *)¬ify);
|
||||
XSync (manager->display, False);
|
||||
|
||||
manager->error_trap_pop ();
|
||||
}
|
||||
|
||||
static int
|
||||
clipboard_bytes_per_item (int format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case 8:
|
||||
return sizeof (char);
|
||||
case 16:
|
||||
return sizeof (short);
|
||||
case 32:
|
||||
return sizeof (long);
|
||||
default: ;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
save_targets (ClipboardManager *manager,
|
||||
Atom *save_targets,
|
||||
int nitems)
|
||||
{
|
||||
int nout, i;
|
||||
Atom *multiple;
|
||||
TargetData *tdata;
|
||||
|
||||
multiple = (Atom *) malloc (2 * nitems * sizeof (Atom));
|
||||
|
||||
nout = 0;
|
||||
for (i = 0; i < nitems; i++)
|
||||
{
|
||||
if (save_targets[i] != XA_TARGETS &&
|
||||
save_targets[i] != XA_MULTIPLE &&
|
||||
save_targets[i] != XA_DELETE &&
|
||||
save_targets[i] != XA_INSERT_PROPERTY &&
|
||||
save_targets[i] != XA_INSERT_SELECTION &&
|
||||
save_targets[i] != XA_PIXMAP)
|
||||
{
|
||||
|
||||
tdata = (TargetData *) malloc (sizeof (TargetData));
|
||||
tdata->data = NULL;
|
||||
tdata->length = 0;
|
||||
tdata->target = save_targets[i];
|
||||
tdata->type = None;
|
||||
tdata->format = 0;
|
||||
tdata->refcount = 1;
|
||||
manager->contents = list_prepend (manager->contents, tdata);
|
||||
|
||||
multiple[nout++] = save_targets[i];
|
||||
multiple[nout++] = save_targets[i];
|
||||
}
|
||||
}
|
||||
|
||||
XFree (save_targets);
|
||||
|
||||
XChangeProperty (manager->display, manager->window,
|
||||
XA_MULTIPLE, XA_ATOM_PAIR,
|
||||
32, PropModeReplace, (char *)multiple, nout);
|
||||
free (multiple);
|
||||
|
||||
XConvertSelection (manager->display, XA_CLIPBOARD,
|
||||
XA_MULTIPLE, XA_MULTIPLE,
|
||||
manager->window, manager->time);
|
||||
}
|
||||
|
||||
static int
|
||||
find_content_target (TargetData *tdata,
|
||||
Atom target)
|
||||
{
|
||||
return tdata->target == target;
|
||||
}
|
||||
|
||||
static int
|
||||
find_content_type (TargetData *tdata,
|
||||
Atom type)
|
||||
{
|
||||
return tdata->type == type;
|
||||
}
|
||||
|
||||
static int
|
||||
find_conversion_requestor (IncrConversion *rdata,
|
||||
XEvent *xev)
|
||||
{
|
||||
return (rdata->requestor == xev->xproperty.window &&
|
||||
rdata->property == xev->xproperty.atom);
|
||||
}
|
||||
|
||||
static void
|
||||
get_property (TargetData *tdata,
|
||||
ClipboardManager *manager)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
unsigned long length;
|
||||
unsigned long remaining;
|
||||
unsigned char *data;
|
||||
|
||||
XGetWindowProperty (manager->display,
|
||||
manager->window,
|
||||
tdata->target,
|
||||
0, 0x1FFFFFFF, True, AnyPropertyType,
|
||||
&type, &format, &length, &remaining,
|
||||
&data);
|
||||
|
||||
if (type == None)
|
||||
{
|
||||
manager->contents = list_remove (manager->contents, tdata);
|
||||
free (tdata);
|
||||
}
|
||||
else if (type == XA_INCR)
|
||||
{
|
||||
tdata->type = type;
|
||||
tdata->length = 0;
|
||||
XFree (data);
|
||||
}
|
||||
else
|
||||
{
|
||||
tdata->type = type;
|
||||
tdata->data = data;
|
||||
tdata->length = length * clipboard_bytes_per_item (format);
|
||||
tdata->format = format;
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
receive_incrementally (ClipboardManager *manager,
|
||||
XEvent *xev)
|
||||
{
|
||||
List *list;
|
||||
TargetData *tdata;
|
||||
Atom type;
|
||||
int format;
|
||||
unsigned long length, nitems, remaining;
|
||||
unsigned char *data;
|
||||
|
||||
if (xev->xproperty.window != manager->window)
|
||||
return False;
|
||||
|
||||
list = list_find (manager->contents,
|
||||
(ListFindFunc)find_content_target, (void *)xev->xproperty.atom);
|
||||
|
||||
if (!list)
|
||||
return False;
|
||||
|
||||
tdata = (TargetData *)list->data;
|
||||
|
||||
if (tdata->type != XA_INCR)
|
||||
return False;
|
||||
|
||||
XGetWindowProperty (xev->xproperty.display,
|
||||
xev->xproperty.window,
|
||||
xev->xproperty.atom,
|
||||
0, 0x1FFFFFFF, True, AnyPropertyType,
|
||||
&type, &format, &nitems, &remaining, &data);
|
||||
|
||||
length = nitems * clipboard_bytes_per_item (format);
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
tdata->type = type;
|
||||
tdata->format = format;
|
||||
|
||||
if (!list_find (manager->contents,
|
||||
(ListFindFunc)find_content_type, (void *)XA_INCR))
|
||||
{
|
||||
/* all incremental transfers done */
|
||||
send_selection_notify (manager, True);
|
||||
manager->requestor = None;
|
||||
}
|
||||
|
||||
XFree (data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!tdata->data)
|
||||
{
|
||||
tdata->data = data;
|
||||
tdata->length = length;
|
||||
}
|
||||
else
|
||||
{
|
||||
tdata->data = realloc (tdata->data, tdata->length + length + 1);
|
||||
memcpy (tdata->data + tdata->length, data, length + 1);
|
||||
tdata->length += length;
|
||||
XFree (data);
|
||||
}
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
static Bool
|
||||
send_incrementally (ClipboardManager *manager,
|
||||
XEvent *xev)
|
||||
{
|
||||
List *list;
|
||||
IncrConversion *rdata;
|
||||
unsigned long length, items;
|
||||
unsigned char *data;
|
||||
|
||||
list = list_find (manager->conversions,
|
||||
(ListFindFunc)find_conversion_requestor, xev);
|
||||
|
||||
if (list == NULL)
|
||||
return False;
|
||||
|
||||
rdata = (IncrConversion *)list->data;
|
||||
|
||||
data = rdata->data->data + rdata->offset;
|
||||
length = rdata->data->length - rdata->offset;
|
||||
if (length > SELECTION_MAX_SIZE)
|
||||
length = SELECTION_MAX_SIZE;
|
||||
|
||||
rdata->offset += length;
|
||||
|
||||
items = length / clipboard_bytes_per_item (rdata->data->format);
|
||||
XChangeProperty (manager->display, rdata->requestor,
|
||||
rdata->property, rdata->data->type,
|
||||
rdata->data->format, PropModeAppend,
|
||||
data, items);
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
manager->conversions = list_remove (manager->conversions, rdata);
|
||||
conversion_free (rdata);
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
static void
|
||||
convert_clipboard_manager (ClipboardManager *manager,
|
||||
XEvent *xev)
|
||||
{
|
||||
Atom type = None;
|
||||
int format;
|
||||
unsigned long nitems, remaining;
|
||||
Atom *targets = NULL;
|
||||
|
||||
if (xev->xselectionrequest.target == XA_SAVE_TARGETS)
|
||||
{
|
||||
if (manager->requestor != None || manager->contents != NULL)
|
||||
{
|
||||
/* We're in the middle of a conversion request, or own
|
||||
* the CLIPBOARD already
|
||||
*/
|
||||
finish_selection_request (manager, xev, False);
|
||||
}
|
||||
else
|
||||
{
|
||||
manager->error_trap_push ();
|
||||
|
||||
manager->watch (xev->xselectionrequest.requestor, True, StructureNotifyMask, manager->cb_data);
|
||||
XSelectInput (manager->display, xev->xselectionrequest.requestor,
|
||||
StructureNotifyMask);
|
||||
XSync (manager->display, False);
|
||||
|
||||
if (manager->error_trap_pop () != Success)
|
||||
return;
|
||||
|
||||
manager->error_trap_push ();
|
||||
|
||||
if (xev->xselectionrequest.property != None)
|
||||
{
|
||||
XGetWindowProperty (manager->display, xev->xselectionrequest.requestor,
|
||||
xev->xselectionrequest.property,
|
||||
0, 0x1FFFFFFF, False, XA_ATOM,
|
||||
&type, &format, &nitems, &remaining,
|
||||
(unsigned char **)&targets);
|
||||
|
||||
if (manager->error_trap_pop () != Success)
|
||||
{
|
||||
if (targets)
|
||||
XFree (targets);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
manager->requestor = xev->xselectionrequest.requestor;
|
||||
manager->property = xev->xselectionrequest.property;
|
||||
manager->time = xev->xselectionrequest.time;
|
||||
|
||||
if (type == None)
|
||||
XConvertSelection (manager->display, XA_CLIPBOARD,
|
||||
XA_TARGETS, XA_TARGETS,
|
||||
manager->window, manager->time);
|
||||
else
|
||||
save_targets (manager, targets, nitems);
|
||||
}
|
||||
}
|
||||
else if (xev->xselectionrequest.target == XA_TIMESTAMP)
|
||||
{
|
||||
XChangeProperty (manager->display,
|
||||
xev->xselectionrequest.requestor,
|
||||
xev->xselectionrequest.property,
|
||||
XA_INTEGER, 32, PropModeReplace,
|
||||
(unsigned char *)&manager->timestamp, 1);
|
||||
|
||||
finish_selection_request (manager, xev, True);
|
||||
}
|
||||
else if (xev->xselectionrequest.target == XA_TARGETS)
|
||||
{
|
||||
int n_targets = 0;
|
||||
Atom targets[3];
|
||||
|
||||
targets[n_targets++] = XA_TARGETS;
|
||||
targets[n_targets++] = XA_TIMESTAMP;
|
||||
targets[n_targets++] = XA_SAVE_TARGETS;
|
||||
|
||||
XChangeProperty (manager->display,
|
||||
xev->xselectionrequest.requestor,
|
||||
xev->xselectionrequest.property,
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(unsigned char *)targets, n_targets);
|
||||
|
||||
finish_selection_request (manager, xev, True);
|
||||
}
|
||||
else
|
||||
{
|
||||
finish_selection_request (manager, xev, False);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
convert_clipboard_target (IncrConversion *rdata,
|
||||
ClipboardManager *manager)
|
||||
{
|
||||
TargetData *tdata;
|
||||
Atom *targets;
|
||||
int n_targets;
|
||||
List *list;
|
||||
unsigned long items;
|
||||
XWindowAttributes atts;
|
||||
|
||||
if (rdata->target == XA_TARGETS)
|
||||
{
|
||||
n_targets = list_length (manager->contents) + 2;
|
||||
targets = (Atom *) malloc (n_targets * sizeof (Atom));
|
||||
|
||||
n_targets = 0;
|
||||
|
||||
targets[n_targets++] = XA_TARGETS;
|
||||
targets[n_targets++] = XA_MULTIPLE;
|
||||
|
||||
for (list = manager->contents; list; list = list->next)
|
||||
{
|
||||
tdata = (TargetData *)list->data;
|
||||
targets[n_targets++] = tdata->target;
|
||||
}
|
||||
|
||||
XChangeProperty (manager->display, rdata->requestor,
|
||||
rdata->property,
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(unsigned char *)targets, n_targets);
|
||||
free (targets);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert from stored CLIPBOARD data */
|
||||
list = list_find (manager->contents,
|
||||
(ListFindFunc)find_content_target, (void *)rdata->target);
|
||||
|
||||
/* We got a target that we don't support */
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
tdata = (TargetData *)list->data;
|
||||
|
||||
if (tdata->type == XA_INCR)
|
||||
{
|
||||
/* we haven't completely received this target yet
|
||||
*/
|
||||
rdata->property = None;
|
||||
return;
|
||||
}
|
||||
|
||||
rdata->data = target_data_ref (tdata);
|
||||
items = tdata->length / clipboard_bytes_per_item (tdata->format);
|
||||
if (tdata->length <= SELECTION_MAX_SIZE)
|
||||
XChangeProperty (manager->display, rdata->requestor,
|
||||
rdata->property,
|
||||
tdata->type, tdata->format, PropModeReplace,
|
||||
tdata->data, items);
|
||||
else
|
||||
{
|
||||
/* start incremental transfer
|
||||
*/
|
||||
rdata->offset = 0;
|
||||
|
||||
manager->error_trap_push ();
|
||||
|
||||
XGetWindowAttributes (manager->display, rdata->requestor, &atts);
|
||||
XSelectInput (manager->display, rdata->requestor,
|
||||
atts.your_event_mask | PropertyChangeMask);
|
||||
|
||||
XChangeProperty (manager->display, rdata->requestor,
|
||||
rdata->property,
|
||||
XA_INCR, 32, PropModeReplace,
|
||||
(unsigned char *)&items, 1);
|
||||
|
||||
XSync (manager->display, False);
|
||||
|
||||
manager->error_trap_pop ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
collect_incremental (IncrConversion *rdata,
|
||||
ClipboardManager *manager)
|
||||
{
|
||||
if (rdata->offset >= 0)
|
||||
manager->conversions = list_prepend (manager->conversions, rdata);
|
||||
else
|
||||
{
|
||||
if (rdata->data)
|
||||
{
|
||||
target_data_unref (rdata->data);
|
||||
rdata->data = NULL;
|
||||
}
|
||||
free (rdata);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
convert_clipboard (ClipboardManager *manager,
|
||||
XEvent *xev)
|
||||
{
|
||||
List *list, *conversions;
|
||||
IncrConversion *rdata;
|
||||
Atom type;
|
||||
int i, format;
|
||||
unsigned long nitems, remaining;
|
||||
Atom *multiple;
|
||||
|
||||
conversions = NULL;
|
||||
type = None;
|
||||
|
||||
if (xev->xselectionrequest.target == XA_MULTIPLE)
|
||||
{
|
||||
|
||||
XGetWindowProperty (xev->xselectionrequest.display,
|
||||
xev->xselectionrequest.requestor,
|
||||
xev->xselectionrequest.property,
|
||||
0, 0x1FFFFFFF, False, XA_ATOM_PAIR,
|
||||
&type, &format, &nitems, &remaining,
|
||||
(unsigned char **)&multiple);
|
||||
|
||||
|
||||
|
||||
if (type != XA_ATOM_PAIR)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nitems; i += 2)
|
||||
{
|
||||
rdata = (IncrConversion *) malloc (sizeof (IncrConversion));
|
||||
rdata->requestor = xev->xselectionrequest.requestor;
|
||||
rdata->target = multiple[i];
|
||||
rdata->property = multiple[i+1];
|
||||
rdata->data = NULL;
|
||||
rdata->offset = -1;
|
||||
conversions = list_prepend (conversions, rdata);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
multiple = NULL;
|
||||
|
||||
rdata = (IncrConversion *) malloc (sizeof (IncrConversion));
|
||||
rdata->requestor = xev->xselectionrequest.requestor;
|
||||
rdata->target = xev->xselectionrequest.target;
|
||||
rdata->property = xev->xselectionrequest.property;
|
||||
rdata->data = NULL;
|
||||
rdata->offset = -1;
|
||||
conversions = list_prepend (conversions, rdata);
|
||||
}
|
||||
|
||||
list_foreach (conversions, (Callback)convert_clipboard_target, manager);
|
||||
|
||||
if (conversions->next == NULL &&
|
||||
((IncrConversion *)conversions->data)->property == None)
|
||||
{
|
||||
finish_selection_request (manager, xev, False);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (multiple)
|
||||
{
|
||||
i = 0;
|
||||
for (list = conversions; list; list = list->next)
|
||||
{
|
||||
rdata = (IncrConversion *)list->data;
|
||||
multiple[i++] = rdata->target;
|
||||
multiple[i++] = rdata->property;
|
||||
}
|
||||
XChangeProperty (xev->xselectionrequest.display,
|
||||
xev->xselectionrequest.requestor,
|
||||
xev->xselectionrequest.property,
|
||||
XA_ATOM_PAIR, 32, PropModeReplace,
|
||||
(unsigned char *)multiple, nitems);
|
||||
}
|
||||
finish_selection_request (manager, xev, True);
|
||||
}
|
||||
|
||||
list_foreach (conversions, (Callback)collect_incremental, manager);
|
||||
list_free (conversions);
|
||||
|
||||
if (multiple)
|
||||
free (multiple);
|
||||
}
|
||||
|
||||
Bool
|
||||
clipboard_manager_process_event (ClipboardManager *manager,
|
||||
XEvent *xev)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
unsigned long nitems;
|
||||
unsigned long remaining;
|
||||
Atom *targets;
|
||||
|
||||
targets = NULL;
|
||||
|
||||
switch (xev->xany.type)
|
||||
{
|
||||
case DestroyNotify:
|
||||
if (xev->xdestroywindow.window == manager->requestor)
|
||||
{
|
||||
list_foreach (manager->contents, (Callback)target_data_unref, NULL);
|
||||
list_free (manager->contents);
|
||||
manager->contents = NULL;
|
||||
|
||||
manager->watch (manager->requestor, False, 0, manager->cb_data);
|
||||
manager->requestor = None;
|
||||
}
|
||||
break;
|
||||
case PropertyNotify:
|
||||
|
||||
if (xev->xproperty.state == PropertyNewValue)
|
||||
return receive_incrementally (manager, xev);
|
||||
else
|
||||
return send_incrementally (manager, xev);
|
||||
|
||||
case SelectionClear:
|
||||
if (xev->xany.window != manager->window)
|
||||
return False;
|
||||
|
||||
if (xev->xselectionclear.selection == XA_CLIPBOARD_MANAGER)
|
||||
{
|
||||
/* We lost the manager selection */
|
||||
if (manager->contents)
|
||||
{
|
||||
list_foreach (manager->contents, (Callback)target_data_unref, NULL);
|
||||
list_free (manager->contents);
|
||||
manager->contents = NULL;
|
||||
|
||||
XSetSelectionOwner (manager->display,
|
||||
XA_CLIPBOARD,
|
||||
None, manager->time);
|
||||
}
|
||||
manager->terminate (manager->cb_data);
|
||||
|
||||
return True;
|
||||
}
|
||||
if (xev->xselectionclear.selection == XA_CLIPBOARD)
|
||||
{
|
||||
/* We lost the clipboard selection */
|
||||
list_foreach (manager->contents, (Callback)target_data_unref, NULL);
|
||||
list_free (manager->contents);
|
||||
manager->contents = NULL;
|
||||
manager->watch (manager->requestor, False, 0, manager->cb_data);
|
||||
manager->requestor = None;
|
||||
|
||||
return True;
|
||||
}
|
||||
break;
|
||||
|
||||
case SelectionNotify:
|
||||
if (xev->xany.window != manager->window)
|
||||
return False;
|
||||
|
||||
if (xev->xselection.selection == XA_CLIPBOARD)
|
||||
{
|
||||
/* a CLIPBOARD conversion is done */
|
||||
if (xev->xselection.property == XA_TARGETS)
|
||||
{
|
||||
XGetWindowProperty (xev->xselection.display,
|
||||
xev->xselection.requestor,
|
||||
xev->xselection.property,
|
||||
0, 0x1FFFFFFF, True, XA_ATOM,
|
||||
&type, &format, &nitems, &remaining,
|
||||
(unsigned char **)&targets);
|
||||
|
||||
save_targets (manager, targets, nitems);
|
||||
}
|
||||
else if (xev->xselection.property == XA_MULTIPLE)
|
||||
{
|
||||
List *tmp;
|
||||
|
||||
tmp = list_copy (manager->contents);
|
||||
list_foreach (tmp, (Callback)get_property, manager);
|
||||
list_free (tmp);
|
||||
|
||||
manager->time = xev->xselection.time;
|
||||
XSetSelectionOwner (manager->display, XA_CLIPBOARD,
|
||||
manager->window, manager->time);
|
||||
|
||||
if (manager->property != None)
|
||||
XChangeProperty (manager->display, manager->requestor,
|
||||
manager->property,
|
||||
XA_ATOM, 32, PropModeReplace,
|
||||
(unsigned char *)&XA_NULL, 1);
|
||||
|
||||
if (!list_find (manager->contents,
|
||||
(ListFindFunc)find_content_type, (void *)XA_INCR))
|
||||
{
|
||||
/* all transfers done */
|
||||
send_selection_notify (manager, True);
|
||||
manager->watch (manager->requestor, False, 0, manager->cb_data);
|
||||
manager->requestor = None;
|
||||
}
|
||||
}
|
||||
else if (xev->xselection.property == None)
|
||||
{
|
||||
send_selection_notify (manager, False);
|
||||
manager->watch (manager->requestor, False, 0, manager->cb_data);
|
||||
manager->requestor = None;
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
break;
|
||||
|
||||
case SelectionRequest:
|
||||
if (xev->xany.window != manager->window)
|
||||
return False;
|
||||
|
||||
if (xev->xselectionrequest.selection == XA_CLIPBOARD_MANAGER)
|
||||
{
|
||||
convert_clipboard_manager (manager, xev);
|
||||
return True;
|
||||
}
|
||||
else if (xev->xselectionrequest.selection == XA_CLIPBOARD)
|
||||
{
|
||||
convert_clipboard (manager, xev);
|
||||
return True;
|
||||
}
|
||||
break;
|
||||
|
||||
default: ;
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool
|
||||
clipboard_manager_check_running (Display *display)
|
||||
{
|
||||
init_atoms (display);
|
||||
|
||||
if (XGetSelectionOwner (display, XA_CLIPBOARD_MANAGER))
|
||||
return True;
|
||||
else
|
||||
return False;
|
||||
}
|
||||
|
||||
ClipboardManager *
|
||||
clipboard_manager_new (Display *display,
|
||||
ClipboardErrorTrapPushFunc error_trap_push_cb,
|
||||
ClipboardErrorTrapPopFunc error_trap_pop_cb,
|
||||
ClipboardTerminateFunc terminate,
|
||||
ClipboardWatchFunc watch,
|
||||
void *cb_data)
|
||||
{
|
||||
ClipboardManager *manager;
|
||||
XClientMessageEvent xev;
|
||||
|
||||
init_atoms (display);
|
||||
|
||||
manager = malloc (sizeof *manager);
|
||||
if (!manager)
|
||||
return NULL;
|
||||
|
||||
manager->display = display;
|
||||
|
||||
manager->error_trap_push = error_trap_push_cb;
|
||||
manager->error_trap_pop = error_trap_pop_cb;
|
||||
|
||||
manager->terminate = terminate;
|
||||
manager->watch = watch;
|
||||
manager->cb_data = cb_data;
|
||||
|
||||
manager->contents = NULL;
|
||||
manager->conversions = NULL;
|
||||
|
||||
manager->requestor = None;
|
||||
|
||||
manager->window = XCreateSimpleWindow (display,
|
||||
DefaultRootWindow (display),
|
||||
0, 0, 10, 10, 0,
|
||||
WhitePixel (display, DefaultScreen (display)),
|
||||
WhitePixel (display, DefaultScreen (display)));
|
||||
|
||||
manager->watch (manager->window, True, PropertyChangeMask, manager->cb_data);
|
||||
XSelectInput (display, manager->window, PropertyChangeMask);
|
||||
manager->timestamp = get_server_time (display, manager->window);
|
||||
|
||||
XSetSelectionOwner (display, XA_CLIPBOARD_MANAGER,
|
||||
manager->window, manager->timestamp);
|
||||
|
||||
/* Check to see if we managed to claim the selection. If not,
|
||||
* we treat it as if we got it then immediately lost it
|
||||
*/
|
||||
|
||||
if (XGetSelectionOwner (display, XA_CLIPBOARD_MANAGER) == manager->window)
|
||||
{
|
||||
xev.type = ClientMessage;
|
||||
xev.window = DefaultRootWindow (display);
|
||||
xev.message_type = XA_MANAGER;
|
||||
xev.format = 32;
|
||||
xev.data.l[0] = manager->timestamp;
|
||||
xev.data.l[1] = XA_CLIPBOARD_MANAGER;
|
||||
xev.data.l[2] = manager->window;
|
||||
xev.data.l[3] = 0; /* manager specific data */
|
||||
xev.data.l[4] = 0; /* manager specific data */
|
||||
|
||||
XSendEvent (display, DefaultRootWindow (display),
|
||||
False, StructureNotifyMask, (XEvent *)&xev);
|
||||
}
|
||||
else
|
||||
{
|
||||
manager->watch (manager->window, False, 0, manager->cb_data);
|
||||
manager->terminate (manager->cb_data);
|
||||
free (manager);
|
||||
manager = NULL;
|
||||
}
|
||||
|
||||
return manager;
|
||||
}
|
||||
|
||||
void
|
||||
clipboard_manager_destroy (ClipboardManager *manager)
|
||||
{
|
||||
if (manager)
|
||||
{
|
||||
manager->watch (manager->window, False, 0, manager->cb_data);
|
||||
XDestroyWindow (manager->display, manager->window);
|
||||
|
||||
list_foreach (manager->conversions, (Callback)conversion_free, NULL);
|
||||
list_free (manager->conversions);
|
||||
|
||||
list_foreach (manager->contents, (Callback)target_data_unref, NULL);
|
||||
list_free (manager->contents);
|
||||
|
||||
free (manager);
|
||||
manager = NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2004 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Red Hat not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Red Hat makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
|
||||
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Matthias Clasen, Red Hat, Inc.
|
||||
*/
|
||||
#ifndef CLIPBOARD_MANAGER_H
|
||||
#define CLIPBOARD_MANAGER_H
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
typedef struct _ClipboardManager ClipboardManager;
|
||||
typedef void (*ClipboardTerminateFunc) (void *data);
|
||||
typedef void (*ClipboardWatchFunc) (Window window,
|
||||
Bool is_start,
|
||||
long mask,
|
||||
void *cb_data);
|
||||
|
||||
typedef void (*ClipboardErrorTrapPushFunc) (void);
|
||||
typedef int (*ClipboardErrorTrapPopFunc) (void);
|
||||
|
||||
ClipboardManager *clipboard_manager_new (Display *display,
|
||||
ClipboardErrorTrapPushFunc error_trap_push_cb,
|
||||
ClipboardErrorTrapPopFunc error_trap_pop_cb,
|
||||
ClipboardTerminateFunc terminate_cb,
|
||||
ClipboardWatchFunc watch_cb,
|
||||
void *cb_data);
|
||||
|
||||
void clipboard_manager_destroy (ClipboardManager *manager);
|
||||
Bool clipboard_manager_process_event (ClipboardManager *manager,
|
||||
XEvent *xev);
|
||||
Bool clipboard_manager_check_running (Display *display);
|
||||
|
||||
|
||||
#endif /* CLIPBOARD_MANAGER_H */
|
|
@ -33,19 +33,17 @@
|
|||
|
||||
#include "gnome-settings-keyboard.h"
|
||||
#include "gnome-settings-module.h"
|
||||
#include "gnome-settings-daemon.h"
|
||||
|
||||
#include "preferences.h"
|
||||
#include "applier.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GnomeSettingsModuleBackground GnomeSettingsModuleBackground;
|
||||
typedef struct _GnomeSettingsModuleBackgroundClass GnomeSettingsModuleBackgroundClass;
|
||||
|
||||
struct _GnomeSettingsModuleBackground {
|
||||
GnomeSettingsModule parent;
|
||||
|
||||
GConfClient *config_client;
|
||||
BGApplier **bg_appliers;
|
||||
BGPreferences *prefs;
|
||||
guint applier_idle_id;
|
||||
|
@ -57,10 +55,9 @@ struct _GnomeSettingsModuleBackgroundClass {
|
|||
|
||||
static void gnome_settings_module_background_class_init (GnomeSettingsModuleBackgroundClass *klass);
|
||||
static void gnome_settings_module_background_init (GnomeSettingsModuleBackground *module);
|
||||
static gboolean gnome_settings_module_background_initialize (GnomeSettingsModule *module, GConfClient *client);
|
||||
static gboolean gnome_settings_module_background_initialize (GnomeSettingsModule *module, GConfClient *config_client);
|
||||
static gboolean gnome_settings_module_background_start (GnomeSettingsModule *module);
|
||||
static GnomeSettingsModuleRunlevel gnome_settings_module_background_get_runlevel (GnomeSettingsModule *module);
|
||||
G_END_DECLS
|
||||
|
||||
static gboolean
|
||||
applier_idle (gpointer data)
|
||||
|
@ -130,7 +127,7 @@ gnome_settings_module_background_get_type (void)
|
|||
(GInstanceInitFunc) gnome_settings_module_background_init,
|
||||
};
|
||||
|
||||
module_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
module_type = g_type_register_static (GNOME_SETTINGS_TYPE_MODULE,
|
||||
"GnomeSettingsModuleBackground",
|
||||
&module_info, 0);
|
||||
}
|
||||
|
@ -138,9 +135,15 @@ gnome_settings_module_background_get_type (void)
|
|||
return module_type;
|
||||
}
|
||||
|
||||
static GnomeSettingsModuleRunlevel
|
||||
gnome_settings_module_background_get_runlevel (GnomeSettingsModule *module)
|
||||
{
|
||||
return GNOME_SETTINGS_MODULE_RUNLEVEL_GNOME_SETTINGS;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnome_settings_module_background_initialize (GnomeSettingsModule *module,
|
||||
GConfClient *client)
|
||||
GConfClient *config_client)
|
||||
{
|
||||
GnomeSettingsModuleBackground *module_bg;
|
||||
GdkDisplay *display;
|
||||
|
@ -165,7 +168,8 @@ gnome_settings_module_background_initialize (GnomeSettingsModule *module,
|
|||
module_bg->prefs = BG_PREFERENCES (bg_preferences_new ());
|
||||
bg_preferences_load (module_bg->prefs);
|
||||
|
||||
gconf_client_notify_add (client,
|
||||
module_bg->config_client = config_client;
|
||||
gconf_client_notify_add (config_client,
|
||||
"/desktop/gnome/background",
|
||||
background_callback,
|
||||
module,
|
||||
|
@ -179,11 +183,9 @@ static gboolean
|
|||
gnome_settings_module_background_start (GnomeSettingsModule *module)
|
||||
{
|
||||
GnomeSettingsModuleBackground *module_bg;
|
||||
GConfClient *client;
|
||||
int i;
|
||||
|
||||
module_bg = (GnomeSettingsModuleBackground *) module;
|
||||
client = gnome_settings_module_get_config_client (module);
|
||||
|
||||
/* If this is set, nautilus will draw the background and is
|
||||
* almost definitely in our session. however, it may not be
|
||||
|
@ -193,7 +195,7 @@ gnome_settings_module_background_start (GnomeSettingsModule *module)
|
|||
* nautilus overwrite it.
|
||||
*/
|
||||
|
||||
if (gconf_client_get_bool (client, "/apps/nautilus/preferences/show_desktop", NULL))
|
||||
if (gconf_client_get_bool (module_bg->config_client, "/apps/nautilus/preferences/show_desktop", NULL))
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; module_bg->bg_appliers [i]; i++)
|
||||
|
@ -201,9 +203,3 @@ gnome_settings_module_background_start (GnomeSettingsModule *module)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GnomeSettingsModuleRunlevel
|
||||
gnome_settings_module_background_get_runlevel (GnomeSettingsModule *module)
|
||||
{
|
||||
return GNOME_SETTINGS_MODULE_RUNLEVEL_GNOME_SETTINGS;
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/* -*- mode: c; style: linux -*- */
|
||||
|
||||
/* gnome-settings-background.h
|
||||
*
|
||||
* Copyright © 2001 Ximian, Inc.
|
||||
*
|
||||
* Written by Bradford Hovinen <hovinen@ximian.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GNOME_SETTINGS_BACKGROUND_H
|
||||
#define __GNOME_SETTINGS_BACKGROUND_H
|
||||
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
void gnome_settings_background_init (GConfClient *client);
|
||||
void gnome_settings_background_load (GConfClient *client);
|
||||
|
||||
#endif
|
|
@ -41,7 +41,6 @@
|
|||
#include "gnome-settings-mouse.h"
|
||||
#include "gnome-settings-keyboard-xkb.h"
|
||||
#include "gnome-settings-keyboard.h"
|
||||
#include "gnome-settings-background.h"
|
||||
#include "gnome-settings-sound.h"
|
||||
#include "gnome-settings-accessibility-keyboard.h"
|
||||
#include "gnome-settings-screensaver.h"
|
||||
|
@ -52,8 +51,6 @@
|
|||
#include "gnome-settings-xrdb.h"
|
||||
#include "gnome-settings-typing-break.h"
|
||||
|
||||
#include "clipboard-manager.h"
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
struct _GnomeSettingsDaemonPrivate {
|
||||
|
@ -61,52 +58,6 @@ struct _GnomeSettingsDaemonPrivate {
|
|||
};
|
||||
|
||||
XSettingsManager **managers = NULL;
|
||||
static ClipboardManager *clipboard_manager;
|
||||
|
||||
static void
|
||||
clipboard_manager_terminate_cb (void *data)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
clipboard_manager_event_filter (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (clipboard_manager_process_event (clipboard_manager,
|
||||
(XEvent *)xevent))
|
||||
return GDK_FILTER_REMOVE;
|
||||
else
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clipboard_manager_watch_cb (Window window,
|
||||
Bool is_start,
|
||||
long mask,
|
||||
void *cb_data)
|
||||
{
|
||||
GdkWindow *gdkwin;
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_display_get_default ();
|
||||
gdkwin = gdk_window_lookup_for_display (display, window);
|
||||
|
||||
if (is_start) {
|
||||
if (!gdkwin)
|
||||
gdkwin = gdk_window_foreign_new_for_display (display, window);
|
||||
else
|
||||
g_object_ref (gdkwin);
|
||||
|
||||
gdk_window_add_filter (gdkwin, clipboard_manager_event_filter, NULL);
|
||||
} else {
|
||||
if (!gdkwin)
|
||||
return;
|
||||
gdk_window_remove_filter (gdkwin, clipboard_manager_event_filter, NULL);
|
||||
g_object_unref (gdkwin);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
terminate_cb (void *data)
|
||||
|
@ -193,8 +144,6 @@ finalize (GObject *object)
|
|||
for (i = 0; managers && managers [i]; i++)
|
||||
xsettings_manager_destroy (managers [i]);
|
||||
|
||||
clipboard_manager_destroy (clipboard_manager);
|
||||
|
||||
if (daemon->priv->loaded_modules) {
|
||||
/* call _stop method on modules, in runlevel-descending order */
|
||||
stop_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_SERVICES);
|
||||
|
@ -233,7 +182,8 @@ gnome_settings_daemon_init (GnomeSettingsDaemon *settings)
|
|||
settings->priv = g_new (GnomeSettingsDaemonPrivate, 1);
|
||||
|
||||
/* register all internal modules types */
|
||||
if (!gnome_settings_module_background_get_type ())
|
||||
if (!gnome_settings_module_background_get_type ()
|
||||
|| !gnome_settings_module_clipboard_get_type ())
|
||||
return;
|
||||
|
||||
/* create hash table for loaded modules */
|
||||
|
@ -314,15 +264,6 @@ gnome_settings_daemon_new (void)
|
|||
managers [i] = NULL;
|
||||
}
|
||||
|
||||
if (!clipboard_manager_check_running (GDK_DISPLAY_XDISPLAY (display))) {
|
||||
clipboard_manager = clipboard_manager_new (GDK_DISPLAY_XDISPLAY (display),
|
||||
gdk_error_trap_push,
|
||||
gdk_error_trap_pop,
|
||||
clipboard_manager_terminate_cb,
|
||||
clipboard_manager_watch_cb,
|
||||
NULL);
|
||||
}
|
||||
|
||||
client = gnome_settings_get_config_client ();
|
||||
|
||||
/* gnome_settings_disk_init (client);*/
|
||||
|
@ -330,7 +271,7 @@ gnome_settings_daemon_new (void)
|
|||
gnome_settings_xsettings_init (client);
|
||||
gnome_settings_mouse_init (client);
|
||||
/* Essential - xkb initialization should happen before */
|
||||
gnome_settings_keyboard_xkb_set_post_activation_callback ((PostActivationCallback)gnome_settings_load_modmap_files, NULL);
|
||||
gnome_settings_keyboard_xkb_set_post_activation_callback ((PostActivationCallback) gnome_settings_load_modmap_files, NULL);
|
||||
gnome_settings_keyboard_xkb_init (client);
|
||||
gnome_settings_keyboard_init (client);
|
||||
gnome_settings_multimedia_keys_init (client);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue