Skip to content

Commit

Permalink
EventEnvironmentChange -> EventWindowScreenChange
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Aug 19, 2021
1 parent a3df066 commit 97f38c3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/java/org/jetbrains/jwm/examples/PanelLayers.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void changeLayer() {

@Override
public void accept(Event e) {
if (e instanceof EventEnvironmentChange) {
if (e instanceof EventWindowScreenChange) {
layer.reconfigure();
accept(new EventWindowResize(window.getWindowRect().getWidth(),
window.getWindowRect().getHeight(),
Expand Down
2 changes: 1 addition & 1 deletion macos/cc/WindowDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)windowDidChangeScreen:(NSNotification*)notification {
NSWindow* window = fWindow->fNSWindow;
CGDirectDisplayID displayID = (CGDirectDisplayID)[[[[window screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
fWindow->reconfigure();
fWindow->dispatch(jwm::classes::EventEnvironmentChange::kInstance);
fWindow->dispatch(jwm::classes::EventWindowScreenChange::kInstance);
}

- (BOOL)windowShouldClose:(NSWindow*)sender {
Expand Down
8 changes: 4 additions & 4 deletions shared/cc/impl/Library.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ namespace jwm {
}
}

namespace EventEnvironmentChange {
namespace EventWindowScreenChange {
jobject kInstance;

void onLoad(JNIEnv* env) {
jclass cls = env->FindClass("org/jetbrains/jwm/EventEnvironmentChange");
jclass cls = env->FindClass("org/jetbrains/jwm/EventWindowScreenChange");
Throwable::exceptionThrown(env);
jfieldID field = env->GetStaticFieldID(cls, "INSTANCE", "Lorg/jetbrains/jwm/EventEnvironmentChange;");
jfieldID field = env->GetStaticFieldID(cls, "INSTANCE", "Lorg/jetbrains/jwm/EventWindowScreenChange;");
jobject instance = env->GetStaticObjectField(cls, field);
kInstance = env->NewGlobalRef(instance);
}
Expand Down Expand Up @@ -467,7 +467,7 @@ extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_jwm_impl_Library__1nAfterLo
jwm::classes::Clipboard::onLoad(env);
jwm::classes::ClipboardEntry::onLoad(env);
jwm::classes::ClipboardFormat::onLoad(env);
jwm::classes::EventEnvironmentChange::onLoad(env);
jwm::classes::EventWindowScreenChange::onLoad(env);
jwm::classes::EventFrame::onLoad(env);
jwm::classes::EventKey::onLoad(env);
jwm::classes::EventMouseButton::onLoad(env);
Expand Down
2 changes: 1 addition & 1 deletion shared/cc/impl/Library.hh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace jwm {
jstring getFormatId(JNIEnv* env, jobject clipboardFormat);
}

namespace EventEnvironmentChange {
namespace EventWindowScreenChange {
extern jobject kInstance;
}

Expand Down
8 changes: 0 additions & 8 deletions shared/java/org/jetbrains/jwm/EventEnvironmentChange.java

This file was deleted.

8 changes: 8 additions & 0 deletions shared/java/org/jetbrains/jwm/EventWindowScreenChange.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.jetbrains.jwm;

import lombok.Data;

@Data
public class EventWindowScreenChange implements Event {
public static final EventWindowScreenChange INSTANCE = new EventWindowScreenChange();
}

0 comments on commit 97f38c3

Please sign in to comment.