Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Dec 23, 2021
1 parent cf0aea3 commit 2abbf9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion shared/cc/Window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void jwm::Window::dispatch(jobject event) {
jwm::classes::Consumer::accept(fEnv, fWindow, event);
}

bool jwm::Window::getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect) {
bool jwm::Window::getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect) const {
JNILocal<jobject> client(fEnv, fEnv->GetObjectField(fWindow, jwm::classes::Window::kTextInputClient));
jwm::classes::Throwable::exceptionThrown(fEnv);
if (client.get()) {
Expand Down
2 changes: 1 addition & 1 deletion shared/cc/Window.hh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace jwm {

void dispatch(jobject event);

bool getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect);
bool getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect) const;

JNIEnv* fEnv = nullptr;
jobject fWindow = nullptr;
Expand Down
8 changes: 4 additions & 4 deletions windows/cc/WindowWin32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ LRESULT jwm::WindowWin32::processEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
// assume page scroll
// https://github.com/mozilla/gecko-dev/blob/da97cbad6c9f00fc596253feb5964a8adbb45d9e/widget/windows/WinMouseScrollHandler.cpp#L891-L903
if (linesPerTick > WHEEL_DELTA) {
float sign = ticks > 0 ? 1 : ticks < 0 ? -1 : 0;
float sign = ticks > 0.0f ? 1.0f : ticks < 0.0f ? -1.0f : 0.0f;
JNILocal<jobject> eventMouseScroll(env, classes::EventMouseScroll::make(env, 0.0f, getContentRect().getHeight() * sign, 0.0f, 0.0f, sign, modifiers));
dispatch(eventMouseScroll.get());
} else {
Expand Down Expand Up @@ -880,9 +880,9 @@ void jwm::WindowWin32::_imeGetCompositionStringConvertedRange(HIMC hImc, int &se
bool jwm::WindowWin32::_imeGetRectForMarkedRange(IRect &rect) const {
// Query current cursor position
// If composition starts, Pos will be always 0
auto sectionStart = static_cast<int>(_compositionPos);
auto sectionEnd = sectionStart + 0;
return this->getRectForMarkedRange(selectionStart, selectionEnd, rect);
auto selectionStart = static_cast<int>(_compositionPos);
auto selectionEnd = selectionStart + 0;
return getRectForMarkedRange(selectionStart, selectionEnd, rect);
}

std::wstring jwm::WindowWin32::_imeGetCompositionString(HIMC hImc, DWORD compType) const {
Expand Down

0 comments on commit 2abbf9a

Please sign in to comment.