Skip to content

Commit 5970495

Browse files
authored
Supports activate/raise/lower window (#122)
1 parent 602060b commit 5970495

File tree

6 files changed

+53
-0
lines changed

6 files changed

+53
-0
lines changed

flutter/shell/platform/tizen/channels/window_channel.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
88
#include "flutter/shell/platform/tizen/channels/encodable_value_holder.h"
99
#include "flutter/shell/platform/tizen/logger.h"
10+
#include "flutter/shell/platform/tizen/tizen_window.h"
11+
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"
1012

1113
namespace flutter {
1214

@@ -72,6 +74,15 @@ void WindowChannel::HandleMethodCall(
7274
result->Success(EncodableValue(map));
7375
} else if (method_name == "getRotation") {
7476
result->Success(EncodableValue(window_->GetRotation()));
77+
} else if (method_name == "activateWindow") {
78+
window_->ActivateWindow();
79+
result->Success();
80+
} else if (method_name == "raiseWindow") {
81+
window_->RaiseWindow();
82+
result->Success();
83+
} else if (method_name == "lowerWindow") {
84+
window_->LowerWindow();
85+
result->Success();
7586
} else {
7687
result->NotImplemented();
7788
}

flutter/shell/platform/tizen/tizen_window.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ class TizenWindow : public TizenViewBase {
3030

3131
virtual void BindKeys(const std::vector<std::string>& keys) = 0;
3232

33+
virtual void ActivateWindow() = 0;
34+
35+
virtual void RaiseWindow() = 0;
36+
37+
virtual void LowerWindow() = 0;
38+
3339
protected:
3440
explicit TizenWindow(TizenGeometry geometry,
3541
bool transparent,

flutter/shell/platform/tizen/tizen_window_ecore_wl2.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,4 +848,16 @@ void TizenWindowEcoreWl2::PrepareInputMethod() {
848848
[this](std::string str) { view_delegate_->OnCommit(str); });
849849
}
850850

851+
void TizenWindowEcoreWl2::ActivateWindow() {
852+
ecore_wl2_window_activate(ecore_wl2_window_);
853+
}
854+
855+
void TizenWindowEcoreWl2::RaiseWindow() {
856+
ecore_wl2_window_raise(ecore_wl2_window_);
857+
}
858+
859+
void TizenWindowEcoreWl2::LowerWindow() {
860+
ecore_wl2_window_lower(ecore_wl2_window_);
861+
}
862+
851863
} // namespace flutter

flutter/shell/platform/tizen/tizen_window_ecore_wl2.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ class TizenWindowEcoreWl2 : public TizenWindow {
5757

5858
void UpdateFlutterCursor(const std::string& kind) override;
5959

60+
void ActivateWindow() override;
61+
62+
void RaiseWindow() override;
63+
64+
void LowerWindow() override;
65+
6066
private:
6167
bool CreateWindow(void* window_handle);
6268

flutter/shell/platform/tizen/tizen_window_elementary.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,16 @@ void TizenWindowElementary::PrepareInputMethod() {
425425
[this](std::string str) { view_delegate_->OnCommit(str); });
426426
}
427427

428+
void TizenWindowElementary::ActivateWindow() {
429+
elm_win_activate(elm_win_);
430+
}
431+
432+
void TizenWindowElementary::RaiseWindow() {
433+
elm_win_raise(elm_win_);
434+
}
435+
436+
void TizenWindowElementary::LowerWindow() {
437+
elm_win_lower(elm_win_);
438+
}
439+
428440
} // namespace flutter

flutter/shell/platform/tizen/tizen_window_elementary.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ class TizenWindowElementary : public TizenWindow {
5454

5555
void UpdateFlutterCursor(const std::string& kind) override;
5656

57+
void ActivateWindow() override;
58+
59+
void RaiseWindow() override;
60+
61+
void LowerWindow() override;
62+
5763
private:
5864
bool CreateWindow();
5965

0 commit comments

Comments
 (0)