aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2018-03-21 14:28:06 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2018-03-21 14:28:06 +1100
commit4382d9d36daac5442c5a31f74c2aa78eb8c278c7 (patch)
tree9d1d6f1591af00bc31b657e3e62e354cf430bbcd
parentac8676c1ee587150376472d542d8cf6f32720bf0 (diff)
downloadscintilla-mirror-4382d9d36daac5442c5a31f74c2aa78eb8c278c7.tar.gz
Backport: Fix some runtime warnings caused by previous change as wSelection
created later and clients (such as SciTE's about box) may use API to set up text before window is realized. Backport of changeset 6637:f5bc6b39f3fa.
-rw-r--r--gtk/ScintillaGTK.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index d285508d2..de1c3e727 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1329,15 +1329,15 @@ void ScintillaGTK::AddToPopUp(const char *label, int cmd, bool enabled) {
}
bool ScintillaGTK::OwnPrimarySelection() {
- return ((gdk_selection_owner_get(GDK_SELECTION_PRIMARY)
- == PWindow(wSelection)) &&
- (PWindow(wSelection) != NULL));
+ return (wSelection.Created() &&
+ (gdk_selection_owner_get(GDK_SELECTION_PRIMARY) == PWindow(wSelection)) &&
+ (PWindow(wSelection) != NULL));
}
void ScintillaGTK::ClaimSelection() {
// X Windows has a 'primary selection' as well as the clipboard.
// Whenever the user selects some text, we become the primary selection
- if (!sel.Empty() && IS_WIDGET_REALIZED(GTK_WIDGET(PWidget(wSelection)))) {
+ if (!sel.Empty() && wSelection.Created() && IS_WIDGET_REALIZED(GTK_WIDGET(PWidget(wSelection)))) {
primarySelection = true;
gtk_selection_owner_set(GTK_WIDGET(PWidget(wSelection)),
GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME);