summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/dialogs.cpp5
-rw-r--r--scene/gui/line_edit.cpp4
-rw-r--r--scene/gui/text_edit.cpp4
-rw-r--r--scene/gui/tree.cpp2
-rw-r--r--scene/gui/video_player.cpp4
5 files changed, 11 insertions, 8 deletions
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index c6897fc684..bacc65c7bf 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -51,7 +51,9 @@ void AcceptDialog::_input_from_window(const Ref<InputEvent> &p_event) {
}
void AcceptDialog::_parent_focused() {
- _cancel_pressed();
+ if (!is_exclusive()) {
+ _cancel_pressed();
+ }
}
void AcceptDialog::_notification(int p_what) {
@@ -295,6 +297,7 @@ AcceptDialog::AcceptDialog() {
set_wrap_controls(true);
set_visible(false);
set_transient(true);
+ set_exclusive(true);
bg = memnew(Panel);
add_child(bg);
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index ba55927980..251f31ce4e 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -688,12 +688,12 @@ void LineEdit::_notification(int p_what) {
update_placeholder_width();
update();
} break;
- case NOTIFICATION_WM_FOCUS_IN: {
+ case NOTIFICATION_WM_WINDOW_FOCUS_IN: {
window_has_focus = true;
draw_caret = true;
update();
} break;
- case NOTIFICATION_WM_FOCUS_OUT: {
+ case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
window_has_focus = false;
draw_caret = false;
update();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index c7fc8dbe43..3860ce61e9 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -603,12 +603,12 @@ void TextEdit::_notification(int p_what) {
_update_wrap_at();
syntax_highlighting_cache.clear();
} break;
- case NOTIFICATION_WM_FOCUS_IN: {
+ case NOTIFICATION_WM_WINDOW_FOCUS_IN: {
window_has_focus = true;
draw_caret = true;
update();
} break;
- case NOTIFICATION_WM_FOCUS_OUT: {
+ case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
window_has_focus = false;
draw_caret = false;
update();
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 7b9db7c081..34161a9e80 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -3410,7 +3410,7 @@ void Tree::scroll_to_item(TreeItem *p_item) {
const Rect2 r = get_item_rect(p_item);
- if (r.position.y < v_scroll->get_value()) {
+ if (r.position.y <= v_scroll->get_value()) {
v_scroll->set_value(r.position.y);
} else if (r.position.y + r.size.y + 2 * cache.vseparation > v_scroll->get_value() + get_size().y) {
v_scroll->set_value(r.position.y + r.size.y + 2 * cache.vseparation - get_size().y);
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 881df06d8f..e118cb0d8d 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -201,10 +201,9 @@ bool VideoPlayer::has_expand() const {
void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) {
stop();
+
AudioServer::get_singleton()->lock();
mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
- AudioServer::get_singleton()->unlock();
-
stream = p_stream;
if (stream.is_valid()) {
stream->set_audio_track(audio_track);
@@ -212,6 +211,7 @@ void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) {
} else {
playback = Ref<VideoStreamPlayback>();
}
+ AudioServer::get_singleton()->unlock();
if (!playback.is_null()) {
playback->set_loop(loops);