Changeset View
Changeset View
Standalone View
Standalone View
src/server/shell_interface.cpp
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Line(s) | 369 | { | |||
---|---|---|---|---|---|
374 | Q_ASSERT(client == *s->client); | 374 | Q_ASSERT(client == *s->client); | ||
375 | // TODO: what about seat and serial? | 375 | // TODO: what about seat and serial? | ||
376 | s->transientFor = QPointer<SurfaceInterface>(SurfaceInterface::get(parent)); | 376 | s->transientFor = QPointer<SurfaceInterface>(SurfaceInterface::get(parent)); | ||
377 | s->transientOffset = QPoint(x, y); | 377 | s->transientOffset = QPoint(x, y); | ||
378 | s->setWindowMode(WindowMode::Popup); | 378 | s->setWindowMode(WindowMode::Popup); | ||
379 | emit s->q_func()->transientChanged(!s->transientFor.isNull()); | 379 | emit s->q_func()->transientChanged(!s->transientFor.isNull()); | ||
380 | emit s->q_func()->transientOffsetChanged(s->transientOffset); | 380 | emit s->q_func()->transientOffsetChanged(s->transientOffset); | ||
381 | emit s->q_func()->transientForChanged(); | 381 | emit s->q_func()->transientForChanged(); | ||
382 | // we ignore the flags as Qt requests keyboard focus for popups | ||||
383 | // if we would honor the flag this could break compositors | ||||
384 | // compare QtWayland (5.6), file qwaylandwlshellsurface.cpp:208 | ||||
382 | s->setAcceptsFocus(WL_SHELL_SURFACE_TRANSIENT_INACTIVE); | 385 | s->setAcceptsFocus(WL_SHELL_SURFACE_TRANSIENT_INACTIVE); | ||
383 | } | 386 | } | ||
384 | 387 | | |||
385 | void ShellSurfaceInterface::Private::setMaximizedCallback(wl_client *client, wl_resource *resource, wl_resource *output) | 388 | void ShellSurfaceInterface::Private::setMaximizedCallback(wl_client *client, wl_resource *resource, wl_resource *output) | ||
386 | { | 389 | { | ||
387 | Q_UNUSED(output) | 390 | Q_UNUSED(output) | ||
388 | auto s = cast<Private>(resource); | 391 | auto s = cast<Private>(resource); | ||
389 | Q_ASSERT(client == *s->client); | 392 | Q_ASSERT(client == *s->client); | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
444 | } | 447 | } | ||
445 | 448 | | |||
446 | bool ShellSurfaceInterface::acceptsKeyboardFocus() const | 449 | bool ShellSurfaceInterface::acceptsKeyboardFocus() const | ||
447 | { | 450 | { | ||
448 | Q_D(); | 451 | Q_D(); | ||
449 | return d->acceptsKeyboardFocus; | 452 | return d->acceptsKeyboardFocus; | ||
450 | } | 453 | } | ||
451 | 454 | | |||
455 | void ShellSurfaceInterface::popupDone() | ||||
456 | { | ||||
457 | Q_D(); | ||||
458 | if (isPopup() && d->resource) { | ||||
459 | wl_shell_surface_send_popup_done(d->resource); | ||||
460 | } | ||||
461 | } | ||||
462 | | ||||
452 | QPointer< SurfaceInterface > ShellSurfaceInterface::transientFor() const | 463 | QPointer< SurfaceInterface > ShellSurfaceInterface::transientFor() const | ||
453 | { | 464 | { | ||
454 | Q_D(); | 465 | Q_D(); | ||
455 | return d->transientFor; | 466 | return d->transientFor; | ||
456 | } | 467 | } | ||
457 | 468 | | |||
458 | ShellSurfaceInterface::Private *ShellSurfaceInterface::d_func() const | 469 | ShellSurfaceInterface::Private *ShellSurfaceInterface::d_func() const | ||
459 | { | 470 | { | ||
460 | return reinterpret_cast<ShellSurfaceInterface::Private*>(d.data()); | 471 | return reinterpret_cast<ShellSurfaceInterface::Private*>(d.data()); | ||
461 | } | 472 | } | ||
462 | 473 | | |||
463 | } | 474 | } | ||
464 | } | 475 | } |