Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/3cead4e8670b4ceb3f5010bd2aaac5d5aa0bd009
...commit
http://git.netsurf-browser.org/netsurf.git/commit/3cead4e8670b4ceb3f5010bd2aaac5d5aa0bd009
...tree
http://git.netsurf-browser.org/netsurf.git/tree/3cead4e8670b4ceb3f5010bd2aaac5d5aa0bd009
The branch, master has been updated
via 3cead4e8670b4ceb3f5010bd2aaac5d5aa0bd009 (commit)
via f8eabec04b5c5823b405440561add3cc47282f11 (commit)
from 833c9957a1137f77e5ab647eeb1a9cf53798fd12 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=3cead4e8670b4ceb3f5010bd2aaac5d5aa0bd009
commit 3cead4e8670b4ceb3f5010bd2aaac5d5aa0bd009
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
risc os: Don't swallow URL bar drags if the OS supports text-selection.
It should still be possible to drag save the URL from the favicon.
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index 15aab3e..63193a4 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -40,6 +40,7 @@
#include "riscos/url_suggest.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
+#include "riscos/wimputils.h"
#include "riscos/window.h"
#include "riscos/ucstables.h"
#include "riscos/filetype.h"
@@ -983,11 +984,13 @@ ro_gui_url_bar_click(struct url_bar *url_bar,
*/
if (pointer->buttons == wimp_DRAG_SELECT ||
pointer->buttons == wimp_DRAG_ADJUST) {
- if (pointer->i == url_bar->text.icon) {
- if (action != NULL) {
- *action = TOOLBAR_URL_DRAG_URL;
+ if (ns_wimp_has_text_selection()) {
+ if (pointer->i == url_bar->text.icon) {
+ if (action != NULL) {
+ *action = TOOLBAR_URL_DRAG_URL;
+ }
+ return true;
}
- return true;
}
if (is_point_in_box(&pos, &url_bar->favicon.extent)) {
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=f8eabec04b5c5823b405440561add3cc47282f11
commit f8eabec04b5c5823b405440561add3cc47282f11
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
risc os: wimputils: Helper to check OS support for text-selection.
diff --git a/frontends/riscos/wimputils.h b/frontends/riscos/wimputils.h
index 5225a72..cb01f1b 100644
--- a/frontends/riscos/wimputils.h
+++ b/frontends/riscos/wimputils.h
@@ -24,6 +24,9 @@
#define riscos_wimputils_h_
#include <oslib/wimp.h>
+#include <oslib/wimpreadsysinfo.h>
+
+#include "utils/log.h"
/* Magical union to permit aliasing of wimp_window_state and wimp_open
* Do not use this directly. Use the macros, instead. */
@@ -62,4 +65,27 @@ typedef union vdu_var_list {
#define PTR_OS_VDU_VAR_LIST(l) ((os_vdu_var_list *) (vdu_var_list *) (l))
+/**
+ * Check whether the OS supports text selection in writiable icons.
+ *
+ * \return true if text-selection is supported, false otherwise.
+ */
+bool ns_wimp_has_text_selection(void)
+{
+ wimp_colour bg;
+ wimp_colour fg;
+ os_error *error;
+ wimpreadsysinfotextselection_flags flags;
+
+ error = xwimpreadsysinfo_text_selection(&bg, &fg, &flags);
+ if (error) {
+ NSLOG(netsurf, WARNING,
+ "xwimpreadsysinfo_text_selection: 0x%x: %s",
+ error->errnum, error->errmess);
+ return false;
+ }
+
+ return (flags & wimpreadsysinfotextselectionflags_ENABLED);
+}
+
#endif
-----------------------------------------------------------------------
Summary of changes:
frontends/riscos/gui/url_bar.c | 11 +++++++----
frontends/riscos/wimputils.h | 26 ++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index 15aab3e..63193a4 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -40,6 +40,7 @@
#include "riscos/url_suggest.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
+#include "riscos/wimputils.h"
#include "riscos/window.h"
#include "riscos/ucstables.h"
#include "riscos/filetype.h"
@@ -983,11 +984,13 @@ ro_gui_url_bar_click(struct url_bar *url_bar,
*/
if (pointer->buttons == wimp_DRAG_SELECT ||
pointer->buttons == wimp_DRAG_ADJUST) {
- if (pointer->i == url_bar->text.icon) {
- if (action != NULL) {
- *action = TOOLBAR_URL_DRAG_URL;
+ if (ns_wimp_has_text_selection()) {
+ if (pointer->i == url_bar->text.icon) {
+ if (action != NULL) {
+ *action = TOOLBAR_URL_DRAG_URL;
+ }
+ return true;
}
- return true;
}
if (is_point_in_box(&pos, &url_bar->favicon.extent)) {
diff --git a/frontends/riscos/wimputils.h b/frontends/riscos/wimputils.h
index 5225a72..cb01f1b 100644
--- a/frontends/riscos/wimputils.h
+++ b/frontends/riscos/wimputils.h
@@ -24,6 +24,9 @@
#define riscos_wimputils_h_
#include <oslib/wimp.h>
+#include <oslib/wimpreadsysinfo.h>
+
+#include "utils/log.h"
/* Magical union to permit aliasing of wimp_window_state and wimp_open
* Do not use this directly. Use the macros, instead. */
@@ -62,4 +65,27 @@ typedef union vdu_var_list {
#define PTR_OS_VDU_VAR_LIST(l) ((os_vdu_var_list *) (vdu_var_list *) (l))
+/**
+ * Check whether the OS supports text selection in writiable icons.
+ *
+ * \return true if text-selection is supported, false otherwise.
+ */
+bool ns_wimp_has_text_selection(void)
+{
+ wimp_colour bg;
+ wimp_colour fg;
+ os_error *error;
+ wimpreadsysinfotextselection_flags flags;
+
+ error = xwimpreadsysinfo_text_selection(&bg, &fg, &flags);
+ if (error) {
+ NSLOG(netsurf, WARNING,
+ "xwimpreadsysinfo_text_selection: 0x%x: %s",
+ error->errnum, error->errmess);
+ return false;
+ }
+
+ return (flags & wimpreadsysinfotextselectionflags_ENABLED);
+}
+
#endif
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]