return priv->lower();
}
+bool DSWindowShell::unsetFocus(void)
+{
+ DS_GET_PRIV(DSWindowShell);
+
+ return priv->unsetFocus();
+}
bool DSWindowShell::setFocus(void)
{
return true;
}
+bool DSWindowShellPrivate::unsetFocus(void)
+{
+ if (__window)
+ return __window->unsetFocus();
+ return false;
+}
bool DSWindowShellPrivate::setFocus(void)
{
- return true;
+ if (__window)
+ return __window->setFocus();
+ return false;
}
bool DSWindowShellPrivate::isFocused(void)
{
- return true;
+ if (__window)
+ return __window->hasFocus();
+ return false;
}
EXPECT_TRUE(shell->isFocused() == true);
}
+TEST_F(DSWindowShellTest, unsetFocus)
+{
+ auto window = std::make_shared<DSWindow>();
+ std::unique_ptr<DSWindowShell> shell = std::make_unique<DSWindowShell>(window.get());
+ EXPECT_TRUE(shell != nullptr);
+
+ EXPECT_TRUE(shell->create(0, 0, 720, 1280, nullptr) == true);
+ EXPECT_TRUE(shell->setFocus() == true);
+ EXPECT_TRUE(shell->isFocused() == true);
+ EXPECT_TRUE(shell->unsetFocus() == true);
+ EXPECT_TRUE(shell->isFocused() != true);
+}
+
TEST_F(DSWindowShellTest, activate_P1)
{
auto window = std::make_shared<DSWindow>();