View | Details | Raw Unified | Return to bug 48951
Collapse All | Expand All

(-)a/libwnck/wnck-handle-private.h (+2 lines)
Lines 26-31 G_BEGIN_DECLS Link Here
26
26
27
WnckClientType   _wnck_handle_get_client_type            (WnckHandle     *self);
27
WnckClientType   _wnck_handle_get_client_type            (WnckHandle     *self);
28
28
29
gboolean         _wnck_handle_has_xres                   (WnckHandle     *self);
30
29
gsize            _wnck_handle_get_default_icon_size      (WnckHandle     *self);
31
gsize            _wnck_handle_get_default_icon_size      (WnckHandle     *self);
30
32
31
gsize            _wnck_handle_get_default_mini_icon_size (WnckHandle     *self);
33
gsize            _wnck_handle_get_default_mini_icon_size (WnckHandle     *self);
(-)a/libwnck/wnck-handle.c (+48 lines)
Lines 29-48 Link Here
29
#include "config.h"
29
#include "config.h"
30
#include "wnck-handle-private.h"
30
#include "wnck-handle-private.h"
31
31
32
#include <X11/Xlib.h>
33
#ifdef HAVE_XRES
34
#include <X11/extensions/XRes.h>
35
#endif
36
32
#include "private.h"
37
#include "private.h"
33
#include "screen.h"
38
#include "screen.h"
34
#include "window.h"
39
#include "window.h"
35
#include "wnck-enum-types.h"
40
#include "wnck-enum-types.h"
36
#include "xutils.h"
41
#include "xutils.h"
37
42
38
struct _WnckHandle
43
struct _WnckHandle
39
{
44
{
40
  GObject          parent;
45
  GObject          parent;
41
46
42
  WnckScreen     **screens;
47
  WnckScreen     **screens;
43
48
44
  WnckClientType   client_type;
49
  WnckClientType   client_type;
45
50
51
  gboolean         have_xres;
52
46
  gsize            default_icon_size;
53
  gsize            default_icon_size;
47
  gsize            default_mini_icon_size;
54
  gsize            default_mini_icon_size;
48
55
Lines 167-172 filter_func (GdkXEvent *gdkxevent, Link Here
167
  return GDK_FILTER_CONTINUE;
174
  return GDK_FILTER_CONTINUE;
168
}
175
}
169
176
177
static void
178
init_xres (WnckHandle *self)
179
{
180
#ifdef HAVE_XRES
181
  Display *xdisplay;
182
  int event_base;
183
  int error_base;
184
  int major;
185
  int minor;
186
187
  xdisplay = _wnck_get_default_display ();
188
  event_base = error_base = major = minor = 0;
189
190
  if (XResQueryExtension (xdisplay, &event_base, &error_base) &&
191
      XResQueryVersion (xdisplay, &major, &minor) == 1)
192
    {
193
      if (major > 1 || (major == 1 && minor >= 2))
194
        self->have_xres = TRUE;
195
    }
196
#endif
197
}
198
199
static void
200
wnck_handle_constructed (GObject *object)
201
{
202
  WnckHandle *self;
203
204
  self = WNCK_HANDLE (object);
205
206
  G_OBJECT_CLASS (wnck_handle_parent_class)->constructed (object);
207
208
  init_xres (self);
209
}
210
170
static void
211
static void
171
wnck_handle_finalize (GObject *object)
212
wnck_handle_finalize (GObject *object)
172
{
213
{
Lines 293-298 wnck_handle_class_init (WnckHandleClass *self_class) Link Here
293
334
294
  object_class = G_OBJECT_CLASS (self_class);
335
  object_class = G_OBJECT_CLASS (self_class);
295
336
337
  object_class->constructed = wnck_handle_constructed;
296
  object_class->finalize = wnck_handle_finalize;
338
  object_class->finalize = wnck_handle_finalize;
297
  object_class->get_property = wnck_handle_get_property;
339
  object_class->get_property = wnck_handle_get_property;
298
  object_class->set_property = wnck_handle_set_property;
340
  object_class->set_property = wnck_handle_set_property;
Lines 346-351 _wnck_handle_get_client_type (WnckHandle *self) Link Here
346
  return self->client_type;
388
  return self->client_type;
347
}
389
}
348
390
391
gboolean
392
_wnck_handle_has_xres (WnckHandle *self)
393
{
394
  return self->have_xres;
395
}
396
349
/**
397
/**
350
 * wnck_handle_get_default_screen:
398
 * wnck_handle_get_default_screen:
351
 * @self: a #WnckHandle
399
 * @self: a #WnckHandle
(-)a/meson.build (-1 / +1 lines)
Lines 45-51 pkg_deps = [ Link Here
45
  {'name': 'gtk+-3.0', 'version': '>= 3.22.0' },
45
  {'name': 'gtk+-3.0', 'version': '>= 3.22.0' },
46
  {'name': STARTUP_NOTIFICATION_PACKAGE, 'version': '>= 0.4', 'required': get_option('startup_notification')},
46
  {'name': STARTUP_NOTIFICATION_PACKAGE, 'version': '>= 0.4', 'required': get_option('startup_notification')},
47
  {'name': X11_PACKAGE },
47
  {'name': X11_PACKAGE },
48
  {'name': XRES_PACKAGE, 'required': false},
48
  {'name': XRES_PACKAGE, 'version': '>= 1.2', 'required': false},
49
]
49
]
50
50
51
foreach p: pkg_deps
51
foreach p: pkg_deps

Return to bug 48951