diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-07-13 13:30:40 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-07-13 13:30:40 +0000 |
commit | c9d424fa2498029d496e121f328db5a5c46a965f (patch) | |
tree | f326eee4472167633c302c8828ea0deb83b96100 | |
parent | 9c918930289b18dbfd4bb44081891d5780105bfd (diff) | |
download | netsurf-c9d424fa2498029d496e121f328db5a5c46a965f.tar.gz netsurf-c9d424fa2498029d496e121f328db5a5c46a965f.tar.bz2 |
Fix up Windows front end. Stop it poking inside selection contexts.
svn path=/trunk/netsurf/; revision=12599
-rw-r--r-- | windows/gui.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/windows/gui.c b/windows/gui.c index d0c6eec50..285a8dd51 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -358,6 +358,7 @@ static void nsws_window_update_forward_back(struct gui_window *w) static void nsws_update_edit(struct gui_window *w) { bool paste, copy, del; + bool sel = (w->bw != NULL && browser_window_has_selection(w->bw)); if (GetFocus() == w->urlbar) { DWORD i, ii; SendMessage(w->urlbar, EM_GETSEL, (WPARAM)&i, (LPARAM)&ii); @@ -365,11 +366,10 @@ static void nsws_update_edit(struct gui_window *w) copy = (i != ii); del = (i != ii); - } else if ((w->bw != NULL) && (w->bw->sel != NULL)){ + } else if (sel){ paste = (w->bw->paste_callback != NULL); - copy = w->bw->sel->defined; - del = ((w->bw->sel->defined) && - (w->bw->caret_callback != NULL)); + copy = sel; + del = (sel && (w->bw->caret_callback != NULL)); } else { paste = false; copy = false; @@ -777,7 +777,8 @@ nsws_window_command(HWND hwnd, if (GetFocus() == gw->urlbar) { SendMessage(gw->urlbar, WM_COPY, 0, 0); } else if (gw->bw != NULL) { - gui_copy_to_clipboard(gw->bw->sel); + gui_copy_to_clipboard( + browser_window_get_selection(gw->bw)); } break; @@ -808,7 +809,8 @@ nsws_window_command(HWND hwnd, if (GetFocus() == gw->urlbar) SendMessage(gw->urlbar, EM_SETSEL, 0, -1); else - selection_select_all(gw->bw->sel); + selection_select_all( + browser_window_get_selection(gw->bw)); break; case IDM_EDIT_SEARCH: |