Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/decoration_input_test.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 174 | { | |||
---|---|---|---|---|---|
180 | QTest::newRow("top") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::WlShell; | 180 | QTest::newRow("top") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::WlShell; | ||
181 | QTest::newRow("topRight") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::WlShell; | 181 | QTest::newRow("topRight") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::WlShell; | ||
182 | QTest::newRow("topLeft|xdgv5") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV5; | 182 | QTest::newRow("topLeft|xdgv5") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV5; | ||
183 | QTest::newRow("top|xdgv5") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV5; | 183 | QTest::newRow("top|xdgv5") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV5; | ||
184 | QTest::newRow("topRight|xdgv5") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV5; | 184 | QTest::newRow("topRight|xdgv5") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV5; | ||
185 | QTest::newRow("topLeft|xdgv6") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV6; | 185 | QTest::newRow("topLeft|xdgv6") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV6; | ||
186 | QTest::newRow("top|xdgv6") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV6; | 186 | QTest::newRow("top|xdgv6") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV6; | ||
187 | QTest::newRow("topRight|xdgv6") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV6; | 187 | QTest::newRow("topRight|xdgv6") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV6; | ||
188 | QTest::newRow("topLeft|xdgWmBase") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellStable; | ||||
189 | QTest::newRow("top|xdgWmBase") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellStable; | ||||
190 | QTest::newRow("topRight|xdgWmBase") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellStable; | ||||
188 | } | 191 | } | ||
189 | 192 | | |||
190 | void DecorationInputTest::testAxis() | 193 | void DecorationInputTest::testAxis() | ||
191 | { | 194 | { | ||
192 | QFETCH(Test::ShellSurfaceType, type); | 195 | QFETCH(Test::ShellSurfaceType, type); | ||
193 | AbstractClient *c = showWindow(type); | 196 | AbstractClient *c = showWindow(type); | ||
194 | QVERIFY(c); | 197 | QVERIFY(c); | ||
195 | QVERIFY(c->isDecorated()); | 198 | QVERIFY(c->isDecorated()); | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 234 | { | |||
237 | QTest::newRow("top") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::WlShell; | 240 | QTest::newRow("top") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::WlShell; | ||
238 | QTest::newRow("topRight") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::WlShell; | 241 | QTest::newRow("topRight") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::WlShell; | ||
239 | QTest::newRow("topLeft|xdgv5") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV5; | 242 | QTest::newRow("topLeft|xdgv5") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV5; | ||
240 | QTest::newRow("top|xdgv5") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV5; | 243 | QTest::newRow("top|xdgv5") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV5; | ||
241 | QTest::newRow("topRight|xdgv5") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV5; | 244 | QTest::newRow("topRight|xdgv5") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV5; | ||
242 | QTest::newRow("topLeft|xdgv6") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV6; | 245 | QTest::newRow("topLeft|xdgv6") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV6; | ||
243 | QTest::newRow("top|xdgv6") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV6; | 246 | QTest::newRow("top|xdgv6") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV6; | ||
244 | QTest::newRow("topRight|xdgv6") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV6; | 247 | QTest::newRow("topRight|xdgv6") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV6; | ||
248 | QTest::newRow("topLeft|xdgWmBase") << QPoint(0, 0) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellStable; | ||||
249 | QTest::newRow("top|xdgWmBase") << QPoint(250, 0) << Qt::TopSection << Test::ShellSurfaceType::XdgShellStable; | ||||
250 | QTest::newRow("topRight|xdgWmBase") << QPoint(499, 0) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellStable; | ||||
245 | } | 251 | } | ||
246 | 252 | | |||
247 | void KWin::DecorationInputTest::testDoubleClick() | 253 | void KWin::DecorationInputTest::testDoubleClick() | ||
248 | { | 254 | { | ||
249 | QFETCH(Test::ShellSurfaceType, type); | 255 | QFETCH(Test::ShellSurfaceType, type); | ||
250 | AbstractClient *c = showWindow(type); | 256 | AbstractClient *c = showWindow(type); | ||
251 | QVERIFY(c); | 257 | QVERIFY(c); | ||
252 | QVERIFY(c->isDecorated()); | 258 | QVERIFY(c->isDecorated()); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 295 | { | |||
295 | QTest::newRow("top") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::WlShell; | 301 | QTest::newRow("top") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::WlShell; | ||
296 | QTest::newRow("topRight") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::WlShell; | 302 | QTest::newRow("topRight") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::WlShell; | ||
297 | QTest::newRow("topLeft|xdgv5") << QPoint(10, 10) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV5; | 303 | QTest::newRow("topLeft|xdgv5") << QPoint(10, 10) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV5; | ||
298 | QTest::newRow("top|xdgv5") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV5; | 304 | QTest::newRow("top|xdgv5") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV5; | ||
299 | QTest::newRow("topRight|xdgv5") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV5; | 305 | QTest::newRow("topRight|xdgv5") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV5; | ||
300 | QTest::newRow("topLeft|xdgv6") << QPoint(10, 10) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV6; | 306 | QTest::newRow("topLeft|xdgv6") << QPoint(10, 10) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellV6; | ||
301 | QTest::newRow("top|xdgv6") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV6; | 307 | QTest::newRow("top|xdgv6") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::XdgShellV6; | ||
302 | QTest::newRow("topRight|xdgv6") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV6; | 308 | QTest::newRow("topRight|xdgv6") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellV6; | ||
303 | 309 | QTest::newRow("topLeft|xdgWmBase") << QPoint(10, 10) << Qt::TopLeftSection << Test::ShellSurfaceType::XdgShellStable; | |||
310 | QTest::newRow("top|xdgWmBase") << QPoint(260, 10) << Qt::TopSection << Test::ShellSurfaceType::XdgShellStable; | ||||
311 | QTest::newRow("topRight|xdgWmBase") << QPoint(509, 10) << Qt::TopRightSection << Test::ShellSurfaceType::XdgShellStable; | ||||
304 | } | 312 | } | ||
305 | 313 | | |||
306 | void KWin::DecorationInputTest::testDoubleTap() | 314 | void KWin::DecorationInputTest::testDoubleTap() | ||
307 | { | 315 | { | ||
308 | QFETCH(Test::ShellSurfaceType, type); | 316 | QFETCH(Test::ShellSurfaceType, type); | ||
309 | AbstractClient *c = showWindow(type); | 317 | AbstractClient *c = showWindow(type); | ||
310 | QVERIFY(c); | 318 | QVERIFY(c); | ||
311 | QVERIFY(c->isDecorated()); | 319 | QVERIFY(c->isDecorated()); | ||
Show All 36 Lines | |||||
348 | 356 | | |||
349 | void DecorationInputTest::testHover_data() | 357 | void DecorationInputTest::testHover_data() | ||
350 | { | 358 | { | ||
351 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 359 | QTest::addColumn<Test::ShellSurfaceType>("type"); | ||
352 | 360 | | |||
353 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | 361 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | ||
354 | QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; | 362 | QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; | ||
355 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | 363 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | ||
364 | QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable; | ||||
356 | } | 365 | } | ||
357 | 366 | | |||
358 | void DecorationInputTest::testHover() | 367 | void DecorationInputTest::testHover() | ||
359 | { | 368 | { | ||
360 | QFETCH(Test::ShellSurfaceType, type); | 369 | QFETCH(Test::ShellSurfaceType, type); | ||
361 | AbstractClient *c = showWindow(type); | 370 | AbstractClient *c = showWindow(type); | ||
362 | QVERIFY(c); | 371 | QVERIFY(c); | ||
363 | QVERIFY(c->isDecorated()); | 372 | QVERIFY(c->isDecorated()); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 405 | { | |||
406 | QTest::newRow("To right|xdgv5") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV5; | 415 | QTest::newRow("To right|xdgv5") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV5; | ||
407 | QTest::newRow("To left|xdgv5") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV5; | 416 | QTest::newRow("To left|xdgv5") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV5; | ||
408 | QTest::newRow("To bottom|xdgv5") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV5; | 417 | QTest::newRow("To bottom|xdgv5") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV5; | ||
409 | QTest::newRow("To top|xdgv5") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV5; | 418 | QTest::newRow("To top|xdgv5") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV5; | ||
410 | QTest::newRow("To right|xdgv6") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV6; | 419 | QTest::newRow("To right|xdgv6") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV6; | ||
411 | QTest::newRow("To left|xdgv6") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV6; | 420 | QTest::newRow("To left|xdgv6") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV6; | ||
412 | QTest::newRow("To bottom|xdgv6") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV6; | 421 | QTest::newRow("To bottom|xdgv6") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV6; | ||
413 | QTest::newRow("To top|xdgv6") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV6; | 422 | QTest::newRow("To top|xdgv6") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV6; | ||
423 | QTest::newRow("To right|xdgWmBase") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellStable; | ||||
424 | QTest::newRow("To left|xdgWmBase") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellStable; | ||||
425 | QTest::newRow("To bottom|xdgWmBase") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellStable; | ||||
426 | QTest::newRow("To top|xdgWmBase") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellStable; | ||||
414 | } | 427 | } | ||
415 | 428 | | |||
416 | void DecorationInputTest::testPressToMove() | 429 | void DecorationInputTest::testPressToMove() | ||
417 | { | 430 | { | ||
418 | QFETCH(Test::ShellSurfaceType, type); | 431 | QFETCH(Test::ShellSurfaceType, type); | ||
419 | AbstractClient *c = showWindow(type); | 432 | AbstractClient *c = showWindow(type); | ||
420 | QVERIFY(c); | 433 | QVERIFY(c); | ||
421 | QVERIFY(c->isDecorated()); | 434 | QVERIFY(c->isDecorated()); | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 478 | { | |||
475 | QTest::newRow("To right|xdgv5") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV5; | 488 | QTest::newRow("To right|xdgv5") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV5; | ||
476 | QTest::newRow("To left|xdgv5") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV5; | 489 | QTest::newRow("To left|xdgv5") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV5; | ||
477 | QTest::newRow("To bottom|xdgv5") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV5; | 490 | QTest::newRow("To bottom|xdgv5") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV5; | ||
478 | QTest::newRow("To top|xdgv5") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV5; | 491 | QTest::newRow("To top|xdgv5") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV5; | ||
479 | QTest::newRow("To right|xdgv6") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV6; | 492 | QTest::newRow("To right|xdgv6") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellV6; | ||
480 | QTest::newRow("To left|xdgv6") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV6; | 493 | QTest::newRow("To left|xdgv6") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellV6; | ||
481 | QTest::newRow("To bottom|xdgv6") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV6; | 494 | QTest::newRow("To bottom|xdgv6") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellV6; | ||
482 | QTest::newRow("To top|xdgv6") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV6; | 495 | QTest::newRow("To top|xdgv6") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellV6; | ||
496 | QTest::newRow("To right|xdgWmBase") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::ShellSurfaceType::XdgShellStable; | ||||
497 | QTest::newRow("To left|xdgWmBase") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::ShellSurfaceType::XdgShellStable; | ||||
498 | QTest::newRow("To bottom|xdgWmBase") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::ShellSurfaceType::XdgShellStable; | ||||
499 | QTest::newRow("To top|xdgWmBase") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::ShellSurfaceType::XdgShellStable; | ||||
483 | } | 500 | } | ||
484 | 501 | | |||
485 | void DecorationInputTest::testTapToMove() | 502 | void DecorationInputTest::testTapToMove() | ||
486 | { | 503 | { | ||
487 | QFETCH(Test::ShellSurfaceType, type); | 504 | QFETCH(Test::ShellSurfaceType, type); | ||
488 | AbstractClient *c = showWindow(type); | 505 | AbstractClient *c = showWindow(type); | ||
489 | QVERIFY(c); | 506 | QVERIFY(c); | ||
490 | QVERIFY(c->isDecorated()); | 507 | QVERIFY(c->isDecorated()); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
535 | { | 552 | { | ||
536 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 553 | QTest::addColumn<Test::ShellSurfaceType>("type"); | ||
537 | QTest::addColumn<Qt::Edge>("edge"); | 554 | QTest::addColumn<Qt::Edge>("edge"); | ||
538 | QTest::addColumn<Qt::CursorShape>("expectedCursor"); | 555 | QTest::addColumn<Qt::CursorShape>("expectedCursor"); | ||
539 | 556 | | |||
540 | QTest::newRow("wlShell - left") << Test::ShellSurfaceType::WlShell << Qt::LeftEdge << Qt::SizeHorCursor; | 557 | QTest::newRow("wlShell - left") << Test::ShellSurfaceType::WlShell << Qt::LeftEdge << Qt::SizeHorCursor; | ||
541 | QTest::newRow("xdgShellV5 - left") << Test::ShellSurfaceType::XdgShellV5 << Qt::LeftEdge << Qt::SizeHorCursor; | 558 | QTest::newRow("xdgShellV5 - left") << Test::ShellSurfaceType::XdgShellV5 << Qt::LeftEdge << Qt::SizeHorCursor; | ||
542 | QTest::newRow("xdgShellV6 - left") << Test::ShellSurfaceType::XdgShellV6 << Qt::LeftEdge << Qt::SizeHorCursor; | 559 | QTest::newRow("xdgShellV6 - left") << Test::ShellSurfaceType::XdgShellV6 << Qt::LeftEdge << Qt::SizeHorCursor; | ||
560 | QTest::newRow("xdgWmBase - left") << Test::ShellSurfaceType::XdgShellStable << Qt::LeftEdge << Qt::SizeHorCursor; | ||||
543 | QTest::newRow("wlShell - right") << Test::ShellSurfaceType::WlShell << Qt::RightEdge << Qt::SizeHorCursor; | 561 | QTest::newRow("wlShell - right") << Test::ShellSurfaceType::WlShell << Qt::RightEdge << Qt::SizeHorCursor; | ||
544 | QTest::newRow("xdgShellV5 - right") << Test::ShellSurfaceType::XdgShellV5 << Qt::RightEdge << Qt::SizeHorCursor; | 562 | QTest::newRow("xdgShellV5 - right") << Test::ShellSurfaceType::XdgShellV5 << Qt::RightEdge << Qt::SizeHorCursor; | ||
545 | QTest::newRow("xdgShellV6 - right") << Test::ShellSurfaceType::XdgShellV6 << Qt::RightEdge << Qt::SizeHorCursor; | 563 | QTest::newRow("xdgShellV6 - right") << Test::ShellSurfaceType::XdgShellV6 << Qt::RightEdge << Qt::SizeHorCursor; | ||
564 | QTest::newRow("xdgWmBase - right") << Test::ShellSurfaceType::XdgShellStable << Qt::RightEdge << Qt::SizeHorCursor; | ||||
546 | QTest::newRow("wlShell - bottom") << Test::ShellSurfaceType::WlShell << Qt::BottomEdge << Qt::SizeVerCursor; | 565 | QTest::newRow("wlShell - bottom") << Test::ShellSurfaceType::WlShell << Qt::BottomEdge << Qt::SizeVerCursor; | ||
547 | QTest::newRow("xdgShellV5 - bottom") << Test::ShellSurfaceType::XdgShellV5 << Qt::BottomEdge << Qt::SizeVerCursor; | 566 | QTest::newRow("xdgShellV5 - bottom") << Test::ShellSurfaceType::XdgShellV5 << Qt::BottomEdge << Qt::SizeVerCursor; | ||
548 | QTest::newRow("xdgShellV6 - bottom") << Test::ShellSurfaceType::XdgShellV6 << Qt::BottomEdge << Qt::SizeVerCursor; | 567 | QTest::newRow("xdgShellV6 - bottom") << Test::ShellSurfaceType::XdgShellV6 << Qt::BottomEdge << Qt::SizeVerCursor; | ||
568 | QTest::newRow("xdgWmBase - bottom") << Test::ShellSurfaceType::XdgShellStable << Qt::BottomEdge << Qt::SizeVerCursor; | ||||
549 | } | 569 | } | ||
550 | 570 | | |||
551 | void DecorationInputTest::testResizeOutsideWindow() | 571 | void DecorationInputTest::testResizeOutsideWindow() | ||
552 | { | 572 | { | ||
553 | // this test verifies that one can resize the window outside the decoration with NoSideBorder | 573 | // this test verifies that one can resize the window outside the decoration with NoSideBorder | ||
554 | 574 | | |||
555 | // first adjust config | 575 | // first adjust config | ||
556 | kwinApp()->config()->group("org.kde.kdecoration2").writeEntry("BorderSize", QStringLiteral("None")); | 576 | kwinApp()->config()->group("org.kde.kdecoration2").writeEntry("BorderSize", QStringLiteral("None")); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 621 | { | |||
606 | QTest::addColumn<Test::ShellSurfaceType>("surfaceType"); | 626 | QTest::addColumn<Test::ShellSurfaceType>("surfaceType"); | ||
607 | 627 | | |||
608 | const QString alt = QStringLiteral("Alt"); | 628 | const QString alt = QStringLiteral("Alt"); | ||
609 | const QString meta = QStringLiteral("Meta"); | 629 | const QString meta = QStringLiteral("Meta"); | ||
610 | 630 | | |||
611 | const QVector<std::pair<Test::ShellSurfaceType, QByteArray>> surfaceTypes{ | 631 | const QVector<std::pair<Test::ShellSurfaceType, QByteArray>> surfaceTypes{ | ||
612 | {Test::ShellSurfaceType::WlShell, QByteArrayLiteral("WlShell")}, | 632 | {Test::ShellSurfaceType::WlShell, QByteArrayLiteral("WlShell")}, | ||
613 | {Test::ShellSurfaceType::XdgShellV5, QByteArrayLiteral("XdgShellV5")}, | 633 | {Test::ShellSurfaceType::XdgShellV5, QByteArrayLiteral("XdgShellV5")}, | ||
634 | {Test::ShellSurfaceType::XdgShellV6, QByteArrayLiteral("XdgShellV6")}, | ||||
635 | {Test::ShellSurfaceType::XdgShellStable, QByteArrayLiteral("XdgWmBase")}, | ||||
614 | }; | 636 | }; | ||
615 | 637 | | |||
616 | for (const auto &type: surfaceTypes) { | 638 | for (const auto &type: surfaceTypes) { | ||
617 | QTest::newRow("Left Alt + Left Click" + type.second) << KEY_LEFTALT << BTN_LEFT << alt << false << type.first; | 639 | QTest::newRow("Left Alt + Left Click" + type.second) << KEY_LEFTALT << BTN_LEFT << alt << false << type.first; | ||
618 | QTest::newRow("Left Alt + Right Click" + type.second) << KEY_LEFTALT << BTN_RIGHT << alt << false << type.first; | 640 | QTest::newRow("Left Alt + Right Click" + type.second) << KEY_LEFTALT << BTN_RIGHT << alt << false << type.first; | ||
619 | QTest::newRow("Left Alt + Middle Click" + type.second) << KEY_LEFTALT << BTN_MIDDLE << alt << false << type.first; | 641 | QTest::newRow("Left Alt + Middle Click" + type.second) << KEY_LEFTALT << BTN_MIDDLE << alt << false << type.first; | ||
620 | QTest::newRow("Right Alt + Left Click" + type.second) << KEY_RIGHTALT << BTN_LEFT << alt << false << type.first; | 642 | QTest::newRow("Right Alt + Left Click" + type.second) << KEY_RIGHTALT << BTN_LEFT << alt << false << type.first; | ||
621 | QTest::newRow("Right Alt + Right Click" + type.second) << KEY_RIGHTALT << BTN_RIGHT << alt << false << type.first; | 643 | QTest::newRow("Right Alt + Right Click" + type.second) << KEY_RIGHTALT << BTN_RIGHT << alt << false << type.first; | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 722 | { | |||
704 | QTest::addColumn<Test::ShellSurfaceType>("surfaceType"); | 726 | QTest::addColumn<Test::ShellSurfaceType>("surfaceType"); | ||
705 | 727 | | |||
706 | const QString alt = QStringLiteral("Alt"); | 728 | const QString alt = QStringLiteral("Alt"); | ||
707 | const QString meta = QStringLiteral("Meta"); | 729 | const QString meta = QStringLiteral("Meta"); | ||
708 | 730 | | |||
709 | const QVector<std::pair<Test::ShellSurfaceType, QByteArray>> surfaceTypes{ | 731 | const QVector<std::pair<Test::ShellSurfaceType, QByteArray>> surfaceTypes{ | ||
710 | {Test::ShellSurfaceType::WlShell, QByteArrayLiteral("WlShell")}, | 732 | {Test::ShellSurfaceType::WlShell, QByteArrayLiteral("WlShell")}, | ||
711 | {Test::ShellSurfaceType::XdgShellV5, QByteArrayLiteral("XdgShellV5")}, | 733 | {Test::ShellSurfaceType::XdgShellV5, QByteArrayLiteral("XdgShellV5")}, | ||
734 | {Test::ShellSurfaceType::XdgShellV6, QByteArrayLiteral("XdgShellV6")}, | ||||
735 | {Test::ShellSurfaceType::XdgShellStable, QByteArrayLiteral("XdgWmBase")}, | ||||
712 | }; | 736 | }; | ||
713 | 737 | | |||
714 | for (const auto &type: surfaceTypes) { | 738 | for (const auto &type: surfaceTypes) { | ||
715 | QTest::newRow("Left Alt" + type.second) << KEY_LEFTALT << alt << false << type.first; | 739 | QTest::newRow("Left Alt" + type.second) << KEY_LEFTALT << alt << false << type.first; | ||
716 | QTest::newRow("Right Alt" + type.second) << KEY_RIGHTALT << alt << false << type.first; | 740 | QTest::newRow("Right Alt" + type.second) << KEY_RIGHTALT << alt << false << type.first; | ||
717 | QTest::newRow("Left Meta" + type.second) << KEY_LEFTMETA << meta << false << type.first; | 741 | QTest::newRow("Left Meta" + type.second) << KEY_LEFTMETA << meta << false << type.first; | ||
718 | QTest::newRow("Right Meta" + type.second) << KEY_RIGHTMETA << meta << false << type.first; | 742 | QTest::newRow("Right Meta" + type.second) << KEY_RIGHTMETA << meta << false << type.first; | ||
719 | QTest::newRow("Left Alt/CapsLock" + type.second) << KEY_LEFTALT << alt << true << type.first; | 743 | QTest::newRow("Left Alt/CapsLock" + type.second) << KEY_LEFTALT << alt << true << type.first; | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
767 | 791 | | |||
768 | void DecorationInputTest::testTouchEvents_data() | 792 | void DecorationInputTest::testTouchEvents_data() | ||
769 | { | 793 | { | ||
770 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 794 | QTest::addColumn<Test::ShellSurfaceType>("type"); | ||
771 | 795 | | |||
772 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | 796 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | ||
773 | QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; | 797 | QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; | ||
774 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | 798 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | ||
799 | QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable; | ||||
775 | } | 800 | } | ||
776 | 801 | | |||
777 | class EventHelper : public QObject | 802 | class EventHelper : public QObject | ||
778 | { | 803 | { | ||
779 | Q_OBJECT | 804 | Q_OBJECT | ||
780 | public: | 805 | public: | ||
781 | EventHelper() : QObject() {} | 806 | EventHelper() : QObject() {} | ||
782 | ~EventHelper() override = default; | 807 | ~EventHelper() override = default; | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | |||||
841 | } | 866 | } | ||
842 | 867 | | |||
843 | void DecorationInputTest::testTooltipDoesntEatKeyEvents_data() | 868 | void DecorationInputTest::testTooltipDoesntEatKeyEvents_data() | ||
844 | { | 869 | { | ||
845 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 870 | QTest::addColumn<Test::ShellSurfaceType>("type"); | ||
846 | 871 | | |||
847 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | 872 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | ||
848 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | 873 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | ||
874 | QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable; | ||||
849 | } | 875 | } | ||
850 | 876 | | |||
851 | void DecorationInputTest::testTooltipDoesntEatKeyEvents() | 877 | void DecorationInputTest::testTooltipDoesntEatKeyEvents() | ||
852 | { | 878 | { | ||
853 | // this test verifies that a tooltip on the decoration does not steal key events | 879 | // this test verifies that a tooltip on the decoration does not steal key events | ||
854 | // BUG: 393253 | 880 | // BUG: 393253 | ||
855 | 881 | | |||
856 | // first create a keyboard | 882 | // first create a keyboard | ||
Show All 39 Lines |