diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2018-03-21 14:28:06 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2018-03-21 14:28:06 +1100 |
commit | 9e4cdff7752304fff978ab7f606b64ea85310baf (patch) | |
tree | 1ec3468692cab0fd71053b2c1f8e3482c12901d7 /gtk/ScintillaGTK.cxx | |
parent | d268deeba70270cd80d8d920338b03971bcbc010 (diff) | |
download | scintilla-mirror-9e4cdff7752304fff978ab7f606b64ea85310baf.tar.gz |
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.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r-- | gtk/ScintillaGTK.cxx | 8 |
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); |