KWayland

xdgshell_v6.cpp
1 /*
2  SPDX-FileCopyrightText: 2017 David Edmundson <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #include "xdgshell_p.h"
7 #include "event_queue.h"
8 #include "output.h"
9 #include "seat.h"
10 #include "surface.h"
11 #include "wayland_pointer_p.h"
12 #include <wayland-xdg-shell-v6-client-protocol.h>
13 
14 #include <QDebug>
15 
16 namespace KWayland
17 {
18 namespace Client
19 {
20 
21 class XdgShellUnstableV6::Private : public XdgShell::Private
22 {
23 public:
24  void setupV6(zxdg_shell_v6 *shell) override;
25  void release() override;
26  void destroy() override;
27  bool isValid() const override;
28  XdgShellSurface *getXdgSurface(Surface *surface, QObject *parent) override;
29 
30  XdgShellPopup *getXdgPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent) override;
31  XdgShellPopup *getXdgPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent) override;
32 
33  using XdgShell::Private::operator xdg_wm_base*;
34  using XdgShell::Private::operator xdg_shell*;
35  operator zxdg_shell_v6*() override {
36  return xdgshellv6;
37  }
38  operator zxdg_shell_v6*() const override {
39  return xdgshellv6;
40  }
41 
42 private:
43  XdgShellPopup *internalGetXdgPopup(Surface *surface, zxdg_surface_v6 *parentSurface, const XdgPositioner &positioner, QObject *parent);
44  static void pingCallback(void *data, struct zxdg_shell_v6 *shell, uint32_t serial);
45 
46  WaylandPointer<zxdg_shell_v6, zxdg_shell_v6_destroy> xdgshellv6;
47  static const struct zxdg_shell_v6_listener s_shellListener;
48 };
49 
50 const struct zxdg_shell_v6_listener XdgShellUnstableV6::Private::s_shellListener = {
51  pingCallback,
52 };
53 
54 void XdgShellUnstableV6::Private::pingCallback(void *data, struct zxdg_shell_v6 *shell, uint32_t serial)
55 {
56  Q_UNUSED(data)
57  zxdg_shell_v6_pong(shell, serial);
58 }
59 
60 void XdgShellUnstableV6::Private::setupV6(zxdg_shell_v6 *shell)
61 {
62  Q_ASSERT(shell);
63  Q_ASSERT(!xdgshellv6);
64  xdgshellv6.setup(shell);
65  zxdg_shell_v6_add_listener(shell, &s_shellListener, this);
66 }
67 
68 void XdgShellUnstableV6::Private::release()
69 {
70  xdgshellv6.release();
71 }
72 
73 void XdgShellUnstableV6::Private::destroy()
74 {
75  xdgshellv6.destroy();
76 }
77 
78 bool XdgShellUnstableV6::Private::isValid() const
79 {
80  return xdgshellv6.isValid();
81 }
82 
83 XdgShellSurface *XdgShellUnstableV6::Private::getXdgSurface(Surface *surface, QObject *parent)
84 {
85  Q_ASSERT(isValid());
86  auto ss = zxdg_shell_v6_get_xdg_surface(xdgshellv6, *surface);
87 
88  if (!ss) {
89  return nullptr;
90  }
91 
92  auto s = new XdgTopLevelUnstableV6(parent);
93  auto toplevel = zxdg_surface_v6_get_toplevel(ss);
94  if (queue) {
95  queue->addProxy(ss);
96  queue->addProxy(toplevel);
97  }
98  s->setup(ss, toplevel);
99  return s;
100 }
101 
102 XdgShellPopup *XdgShellUnstableV6::Private::getXdgPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent)
103 {
104  return internalGetXdgPopup(surface, *parentSurface, positioner, parent);
105 }
106 
107 XdgShellPopup *XdgShellUnstableV6::Private::getXdgPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent)
108 {
109  return internalGetXdgPopup(surface, *parentSurface, positioner, parent);
110 }
111 
112 XdgShellPopup *XdgShellUnstableV6::Private::internalGetXdgPopup(Surface *surface, zxdg_surface_v6 *parentSurface, const XdgPositioner &positioner, QObject *parent)
113 {
114  Q_ASSERT(isValid());
115  auto ss = zxdg_shell_v6_get_xdg_surface(xdgshellv6, *surface);
116  if (!ss) {
117  return nullptr;
118  }
119 
120  auto p = zxdg_shell_v6_create_positioner(xdgshellv6);
121 
122  auto anchorRect = positioner.anchorRect();
123  zxdg_positioner_v6_set_anchor_rect(p, anchorRect.x(), anchorRect.y(), anchorRect.width(), anchorRect.height());
124 
125  QSize initialSize = positioner.initialSize();
126  zxdg_positioner_v6_set_size(p, initialSize.width(), initialSize.height());
127 
128  QPoint anchorOffset = positioner.anchorOffset();
129  if (!anchorOffset.isNull()) {
130  zxdg_positioner_v6_set_offset(p, anchorOffset.x(), anchorOffset.y());
131  }
132 
133  uint32_t anchor = 0;
134  if (positioner.anchorEdge().testFlag(Qt::LeftEdge)) {
135  anchor |= ZXDG_POSITIONER_V6_ANCHOR_LEFT;
136  }
137  if (positioner.anchorEdge().testFlag(Qt::TopEdge)) {
138  anchor |= ZXDG_POSITIONER_V6_ANCHOR_TOP;
139  }
140  if (positioner.anchorEdge().testFlag(Qt::RightEdge)) {
141  anchor |= ZXDG_POSITIONER_V6_ANCHOR_RIGHT;
142  }
143  if (positioner.anchorEdge().testFlag(Qt::BottomEdge)) {
144  anchor |= ZXDG_POSITIONER_V6_ANCHOR_BOTTOM;
145  }
146  if (anchor != 0) {
147  zxdg_positioner_v6_set_anchor(p, anchor);
148  }
149 
150  uint32_t gravity = 0;
151  if (positioner.gravity().testFlag(Qt::LeftEdge)) {
152  gravity |= ZXDG_POSITIONER_V6_GRAVITY_LEFT;
153  }
154  if (positioner.gravity().testFlag(Qt::TopEdge)) {
155  gravity |= ZXDG_POSITIONER_V6_GRAVITY_TOP;
156  }
157  if (positioner.gravity().testFlag(Qt::RightEdge)) {
158  gravity |= ZXDG_POSITIONER_V6_GRAVITY_RIGHT;
159  }
160  if (positioner.gravity().testFlag(Qt::BottomEdge)) {
161  gravity |= ZXDG_POSITIONER_V6_GRAVITY_BOTTOM;
162  }
163  if (gravity != 0) {
164  zxdg_positioner_v6_set_gravity(p, gravity);
165  }
166 
167  uint32_t constraint = 0;
168 
169  if (positioner.constraints().testFlag(XdgPositioner::Constraint::SlideX)) {
170  constraint |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X;
171  }
172  if (positioner.constraints().testFlag(XdgPositioner::Constraint::SlideY)) {
173  constraint |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y;
174  }
175  if (positioner.constraints().testFlag(XdgPositioner::Constraint::FlipX)) {
176  constraint |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X;
177  }
178  if (positioner.constraints().testFlag(XdgPositioner::Constraint::FlipY)) {
179  constraint |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y;
180  }
181  if (positioner.constraints().testFlag(XdgPositioner::Constraint::ResizeX)) {
182  constraint |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X;
183  }
184  if (positioner.constraints().testFlag(XdgPositioner::Constraint::ResizeY)) {
185  constraint |= ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y;
186  }
187  if (constraint != 0) {
188  zxdg_positioner_v6_set_constraint_adjustment(p, constraint);
189  }
190 
191  XdgShellPopup *s = new XdgShellPopupUnstableV6(parent);
192  auto popup = zxdg_surface_v6_get_popup(ss, parentSurface, p);
193  if (queue) {
194  //deliberately not adding the positioner because the positioner has no events sent to it
195  queue->addProxy(ss);
196  queue->addProxy(popup);
197  }
198  s->setup(ss, popup);
199 
200  zxdg_positioner_v6_destroy(p);
201 
202  return s;
203 }
204 
205 XdgShellUnstableV6::XdgShellUnstableV6(QObject *parent)
206  : XdgShell(new Private, parent)
207 {
208 }
209 
210 XdgShellUnstableV6::~XdgShellUnstableV6() = default;
211 
212 
213 //A top level wraps both xdg_surface_v6 and xdg_top_level into the public API XdgShelllSurface
214 class XdgTopLevelUnstableV6::Private : public XdgShellSurface::Private
215 {
216 public:
217  Private(XdgShellSurface *q);
218  WaylandPointer<zxdg_toplevel_v6, zxdg_toplevel_v6_destroy> xdgtoplevelv6;
219  WaylandPointer<zxdg_surface_v6, zxdg_surface_v6_destroy> xdgsurfacev6;
220 
221  void setupV6(zxdg_surface_v6 *surface, zxdg_toplevel_v6 *toplevel) override;
222  void release() override;
223  void destroy() override;
224  bool isValid() const override;
225 
226  using XdgShellSurface::Private::operator xdg_surface*;
227  using XdgShellSurface::Private::operator xdg_toplevel*;
228  operator zxdg_surface_v6*() override {
229  return xdgsurfacev6;
230  }
231  operator zxdg_surface_v6*() const override {
232  return xdgsurfacev6;
233  }
234  operator zxdg_toplevel_v6*() override {
235  return xdgtoplevelv6;
236  }
237  operator zxdg_toplevel_v6*() const override {
238  return xdgtoplevelv6;
239  }
240 
241  void setTransientFor(XdgShellSurface *parent) override;
242  void setTitle(const QString &title) override;
243  void setAppId(const QByteArray &appId) override;
244  void showWindowMenu(Seat *seat, quint32 serial, qint32 x, qint32 y) override;
245  void move(Seat *seat, quint32 serial) override;
246  void resize(Seat *seat, quint32 serial, Qt::Edges edges) override;
247  void ackConfigure(quint32 serial) override;
248  void setMaximized() override;
249  void unsetMaximized() override;
250  void setFullscreen(Output *output) override;
251  void unsetFullscreen() override;
252  void setMinimized() override;
253  void setMaxSize(const QSize &size) override;
254  void setMinSize(const QSize &size) override;
255 
256 private:
257  QSize pendingSize;
258  States pendingState;
259 
260  static void configureCallback(void *data, struct zxdg_toplevel_v6 *xdg_toplevel, int32_t width, int32_t height, struct wl_array *state);
261  static void closeCallback(void *data, zxdg_toplevel_v6 *xdg_toplevel);
262  static void surfaceConfigureCallback(void *data, zxdg_surface_v6 *xdg_surface, uint32_t serial);
263 
264  static const struct zxdg_toplevel_v6_listener s_toplevelListener;
265  static const struct zxdg_surface_v6_listener s_surfaceListener;
266 };
267 
268 const struct zxdg_toplevel_v6_listener XdgTopLevelUnstableV6::Private::s_toplevelListener = {
269  configureCallback,
270  closeCallback
271 };
272 
273 const struct zxdg_surface_v6_listener XdgTopLevelUnstableV6::Private::s_surfaceListener = {
274  surfaceConfigureCallback
275 };
276 
277 void XdgTopLevelUnstableV6::Private::surfaceConfigureCallback(void *data, struct zxdg_surface_v6 *surface, uint32_t serial)
278 {
279  Q_UNUSED(surface)
280  auto s = reinterpret_cast<Private*>(data);
281  s->q->configureRequested(s->pendingSize, s->pendingState, serial);
282  if (!s->pendingSize.isNull()) {
283  s->q->setSize(s->pendingSize);
284  s->pendingSize = QSize();
285  }
286  s->pendingState = {};
287 }
288 
289 void XdgTopLevelUnstableV6::Private::configureCallback(void *data, struct zxdg_toplevel_v6 *xdg_toplevel, int32_t width, int32_t height, struct wl_array *state)
290 {
291  Q_UNUSED(xdg_toplevel)
292  auto s = reinterpret_cast<Private*>(data);
293  States states;
294 
295  uint32_t *statePtr = reinterpret_cast<uint32_t *>(state->data);
296  for (size_t i = 0; i < state->size / sizeof(uint32_t); i++) {
297  switch (statePtr[i]) {
298  case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
299  states = states | XdgShellSurface::State::Maximized;
300  break;
301  case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
302  states = states | XdgShellSurface::State::Fullscreen;
303  break;
304  case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
305  states = states | XdgShellSurface::State::Resizing;
306  break;
307  case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
308  states = states | XdgShellSurface::State::Activated;
309  break;
310  }
311  }
312  s->pendingSize = QSize(width, height);
313  s->pendingState = states;
314 }
315 
316 void XdgTopLevelUnstableV6::Private::closeCallback(void *data, zxdg_toplevel_v6 *xdg_toplevel)
317 {
318  auto s = reinterpret_cast<XdgTopLevelUnstableV6::Private*>(data);
319  Q_ASSERT(s->xdgtoplevelv6 == xdg_toplevel);
320  emit s->q->closeRequested();
321 }
322 
323 XdgTopLevelUnstableV6::Private::Private(XdgShellSurface *q)
324  : XdgShellSurface::Private(q)
325 {
326 }
327 
328 void XdgTopLevelUnstableV6::Private::setupV6(zxdg_surface_v6 *surface, zxdg_toplevel_v6 *topLevel)
329 {
330  Q_ASSERT(surface);
331  Q_ASSERT(!xdgtoplevelv6);
332  xdgsurfacev6.setup(surface);
333  xdgtoplevelv6.setup(topLevel);
334  zxdg_surface_v6_add_listener(xdgsurfacev6, &s_surfaceListener, this);
335  zxdg_toplevel_v6_add_listener(xdgtoplevelv6, &s_toplevelListener, this);
336 }
337 
338 void XdgTopLevelUnstableV6::Private::release()
339 {
340  xdgtoplevelv6.release();
341  xdgsurfacev6.release();
342 }
343 
344 void XdgTopLevelUnstableV6::Private::destroy()
345 {
346  xdgtoplevelv6.destroy();
347  xdgsurfacev6.destroy();
348 }
349 
350 bool XdgTopLevelUnstableV6::Private::isValid() const
351 {
352  return xdgtoplevelv6.isValid() && xdgsurfacev6.isValid();
353 }
354 
355 void XdgTopLevelUnstableV6::Private::setTransientFor(XdgShellSurface *parent)
356 {
357  zxdg_toplevel_v6 *parentSurface = nullptr;
358  if (parent) {
359  parentSurface = *parent;
360  }
361  zxdg_toplevel_v6_set_parent(xdgtoplevelv6, parentSurface);
362 }
363 
364 void XdgTopLevelUnstableV6::Private::setTitle(const QString & title)
365 {
366  zxdg_toplevel_v6_set_title(xdgtoplevelv6, title.toUtf8().constData());
367 }
368 
369 void XdgTopLevelUnstableV6::Private::setAppId(const QByteArray & appId)
370 {
371  zxdg_toplevel_v6_set_app_id(xdgtoplevelv6, appId.constData());
372 }
373 
374 void XdgTopLevelUnstableV6::Private::showWindowMenu(Seat *seat, quint32 serial, qint32 x, qint32 y)
375 {
376  zxdg_toplevel_v6_show_window_menu(xdgtoplevelv6, *seat, serial, x, y);
377 }
378 
379 void XdgTopLevelUnstableV6::Private::move(Seat *seat, quint32 serial)
380 {
381  zxdg_toplevel_v6_move(xdgtoplevelv6, *seat, serial);
382 }
383 
384 void XdgTopLevelUnstableV6::Private::resize(Seat *seat, quint32 serial, Qt::Edges edges)
385 {
386  uint wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_NONE;
387  if (edges.testFlag(Qt::TopEdge)) {
388  if (edges.testFlag(Qt::LeftEdge) && ((edges & ~Qt::LeftEdge) == Qt::TopEdge)) {
389  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT;
390  } else if (edges.testFlag(Qt::RightEdge) && ((edges & ~Qt::RightEdge) == Qt::TopEdge)) {
391  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT;
392  } else if ((edges & ~Qt::TopEdge) == Qt::Edges()) {
393  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP;
394  }
395  } else if (edges.testFlag(Qt::BottomEdge)) {
396  if (edges.testFlag(Qt::LeftEdge) && ((edges & ~Qt::LeftEdge) == Qt::BottomEdge)) {
397  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT;
398  } else if (edges.testFlag(Qt::RightEdge) && ((edges & ~Qt::RightEdge) == Qt::BottomEdge)) {
399  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT;
400  } else if ((edges & ~Qt::BottomEdge) == Qt::Edges()) {
401  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM;
402  }
403  } else if (edges.testFlag(Qt::RightEdge) && ((edges & ~Qt::RightEdge) == Qt::Edges())) {
404  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT;
405  } else if (edges.testFlag(Qt::LeftEdge) && ((edges & ~Qt::LeftEdge) == Qt::Edges())) {
406  wlEdge = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT;
407  }
408  zxdg_toplevel_v6_resize(xdgtoplevelv6, *seat, serial, wlEdge);
409 }
410 
411 void XdgTopLevelUnstableV6::Private::ackConfigure(quint32 serial)
412 {
413  zxdg_surface_v6_ack_configure(xdgsurfacev6, serial);
414 }
415 
416 void XdgTopLevelUnstableV6::Private::setMaximized()
417 {
418  zxdg_toplevel_v6_set_maximized(xdgtoplevelv6);
419 }
420 
421 void XdgTopLevelUnstableV6::Private::unsetMaximized()
422 {
423  zxdg_toplevel_v6_unset_maximized(xdgtoplevelv6);
424 }
425 
426 void XdgTopLevelUnstableV6::Private::setFullscreen(Output *output)
427 {
428  wl_output *o = nullptr;
429  if (output) {
430  o = *output;
431  }
432  zxdg_toplevel_v6_set_fullscreen(xdgtoplevelv6, o);
433 }
434 
435 void XdgTopLevelUnstableV6::Private::unsetFullscreen()
436 {
437  zxdg_toplevel_v6_unset_fullscreen(xdgtoplevelv6);
438 }
439 
440 void XdgTopLevelUnstableV6::Private::setMinimized()
441 {
442  zxdg_toplevel_v6_set_minimized(xdgtoplevelv6);
443 }
444 
445 void XdgTopLevelUnstableV6::Private::setMaxSize(const QSize &size)
446 {
447  zxdg_toplevel_v6_set_max_size(xdgtoplevelv6, size.width(), size.height());
448 }
449 
450 void XdgTopLevelUnstableV6::Private::setMinSize(const QSize &size)
451 {
452  zxdg_toplevel_v6_set_min_size(xdgtoplevelv6, size.width(), size.height());
453 }
454 
455 XdgTopLevelUnstableV6::XdgTopLevelUnstableV6(QObject *parent)
456  : XdgShellSurface(new Private(this), parent)
457 {
458 }
459 
460 XdgTopLevelUnstableV6::~XdgTopLevelUnstableV6() = default;
461 
462 class XdgShellPopupUnstableV6::Private : public XdgShellPopup::Private
463 {
464 public:
465  Private(XdgShellPopup *q);
466 
467  void setupV6(zxdg_surface_v6 *s, zxdg_popup_v6 *p) override;
468  void release() override;
469  void destroy() override;
470  bool isValid() const override;
471  void requestGrab(Seat *seat, quint32 serial) override;
472  void ackConfigure(quint32 serial) override;
473 
474  using XdgShellPopup::Private::operator xdg_popup*;
475  using XdgShellPopup::Private::operator xdg_surface*;
476  operator zxdg_surface_v6*() override {
477  return xdgsurfacev6;
478  }
479  operator zxdg_surface_v6*() const override {
480  return xdgsurfacev6;
481  }
482  operator zxdg_popup_v6*() override {
483  return xdgpopupv6;
484  }
485  operator zxdg_popup_v6*() const override {
486  return xdgpopupv6;
487  }
488  WaylandPointer<zxdg_surface_v6, zxdg_surface_v6_destroy> xdgsurfacev6;
489  WaylandPointer<zxdg_popup_v6, zxdg_popup_v6_destroy> xdgpopupv6;
490 
491  QRect pendingRect;
492 
493 private:
494  static void configureCallback(void *data, zxdg_popup_v6 *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height);
495  static void popupDoneCallback(void *data, zxdg_popup_v6 *xdg_popup);
496  static void surfaceConfigureCallback(void *data, zxdg_surface_v6 *xdg_surface, uint32_t serial);
497 
498  static const struct zxdg_popup_v6_listener s_popupListener;
499  static const struct zxdg_surface_v6_listener s_surfaceListener;
500 };
501 
502 const struct zxdg_popup_v6_listener XdgShellPopupUnstableV6::Private::s_popupListener = {
503  configureCallback,
504  popupDoneCallback
505 };
506 
507 const struct zxdg_surface_v6_listener XdgShellPopupUnstableV6::Private::s_surfaceListener = {
508  surfaceConfigureCallback,
509 };
510 
511 void XdgShellPopupUnstableV6::Private::configureCallback(void *data, zxdg_popup_v6 *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height)
512 {
513  Q_UNUSED(xdg_popup);
514  auto s = reinterpret_cast<Private*>(data);
515  s->pendingRect = QRect(x, y, width, height);
516 }
517 
518 void XdgShellPopupUnstableV6::Private::surfaceConfigureCallback(void *data, struct zxdg_surface_v6 *surface, uint32_t serial)
519 {
520  Q_UNUSED(surface);
521  auto s = reinterpret_cast<Private*>(data);
522  s->q->configureRequested(s->pendingRect, serial);
523  s->pendingRect = QRect();
524 }
525 
526 void XdgShellPopupUnstableV6::Private::popupDoneCallback(void *data, zxdg_popup_v6 *xdg_popup)
527 {
528  auto s = reinterpret_cast<XdgShellPopupUnstableV6::Private*>(data);
529  Q_ASSERT(s->xdgpopupv6 == xdg_popup);
530  emit s->q->popupDone();
531 }
532 
533 XdgShellPopupUnstableV6::Private::Private(XdgShellPopup *q)
534  : XdgShellPopup::Private(q)
535 {
536 }
537 
538 void XdgShellPopupUnstableV6::Private::setupV6(zxdg_surface_v6 *s, zxdg_popup_v6 *p)
539 {
540  Q_ASSERT(p);
541  Q_ASSERT(!xdgsurfacev6);
542  Q_ASSERT(!xdgpopupv6);
543 
544  xdgsurfacev6.setup(s);
545  xdgpopupv6.setup(p);
546  zxdg_surface_v6_add_listener(xdgsurfacev6, &s_surfaceListener, this);
547  zxdg_popup_v6_add_listener(xdgpopupv6, &s_popupListener, this);
548 }
549 
550 void XdgShellPopupUnstableV6::Private::release()
551 {
552  xdgpopupv6.release();
553 }
554 
555 void XdgShellPopupUnstableV6::Private::destroy()
556 {
557  xdgpopupv6.destroy();
558 }
559 
560 bool XdgShellPopupUnstableV6::Private::isValid() const
561 {
562  return xdgpopupv6.isValid();
563 }
564 
565 void XdgShellPopupUnstableV6::Private::requestGrab(Seat *seat, quint32 serial)
566 {
567  zxdg_popup_v6_grab(xdgpopupv6, *seat, serial);
568 }
569 
570 void XdgShellPopupUnstableV6::Private::ackConfigure(quint32 serial)
571 {
572  zxdg_surface_v6_ack_configure(xdgsurfacev6, serial);
573 }
574 
575 XdgShellPopupUnstableV6::XdgShellPopupUnstableV6(QObject *parent)
576  : XdgShellPopup(new Private(this), parent)
577 {
578 }
579 
580 XdgShellPopupUnstableV6::~XdgShellPopupUnstableV6() = default;
581 
582 }
583 }
int width() const const
LeftEdge
const char * constData() const const
int height() const const
KIOCORE_EXPORT CopyJob * move(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
QObject * parent() const const
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.