[iagno/arnaudb/wip/gtk4: 18/54] Comment clipboard-related things.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno/arnaudb/wip/gtk4: 18/54] Comment clipboard-related things.
- Date: Thu, 30 Apr 2020 13:18:56 +0000 (UTC)
commit b391eec7d3d56ed5d6c630c23e1df4ab9a2c1aed
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Feb 14 19:00:35 2020 +0100
Comment clipboard-related things.
src/base-window.vala | 116 +++++++++++++++++++++++++--------------------------
src/iagno.vala | 10 ++---
2 files changed, 63 insertions(+), 63 deletions(-)
---
diff --git a/src/base-window.vala b/src/base-window.vala
index c1ce2a7..e1eb996 100644
--- a/src/base-window.vala
+++ b/src/base-window.vala
@@ -156,16 +156,16 @@ private class BaseWindow : AdaptativeWindow, AdaptativeWidget
}
internal static bool copy_clipboard_text (out string copy_text)
{
- string? nullable_selection = Clipboard.@get (Gdk.SELECTION_PRIMARY).wait_for_text ();
- if (nullable_selection != null)
- {
- string selection = ((!) nullable_selection).dup ();
- if (selection != "")
- {
- copy_text = selection;
- return true;
- }
- }
+// string? nullable_selection = Clipboard.@get (Gdk.SELECTION_PRIMARY).wait_for_text ();
+// if (nullable_selection != null)
+// {
+// string selection = ((!) nullable_selection).dup ();
+// if (selection != "")
+// {
+// copy_text = selection;
+// return true;
+// }
+// }
return no_copy_text (out copy_text);
}
internal static inline bool is_empty_text (string text)
@@ -175,42 +175,42 @@ private class BaseWindow : AdaptativeWindow, AdaptativeWidget
private void copy (/* SimpleAction action, Variant? path_variant */)
{
- Widget? focus = get_focus ();
- if (focus != null)
- {
- if ((!) focus is Editable) // GtkEntry, GtkSearchEntry, GtkSpinButton
- {
- int garbage1, garbage2;
- if (((Editable) (!) focus).get_selection_bounds (out garbage1, out garbage2))
- {
- ((Editable) (!) focus).copy_clipboard ();
- return;
- }
- }
- else if ((!) focus is TextView)
- {
- if (((TextView) (!) focus).get_buffer ().get_has_selection ())
- {
- ((TextView) (!) focus).copy_clipboard ();
- return;
- }
- }
- else if ((!) focus is Label)
- {
- int garbage1, garbage2;
- if (((Label) (!) focus).get_selection_bounds (out garbage1, out garbage2))
- {
- ((Label) (!) focus).copy_clipboard ();
- return;
- }
- }
- }
-
- main_view.close_popovers ();
-
- string text;
- if (handle_copy_text (out text))
- copy_text (text);
+// Widget? focus = get_focus ();
+// if (focus != null)
+// {
+// if ((!) focus is Editable) // GtkEntry, GtkSearchEntry, GtkSpinButton
+// {
+// int garbage1, garbage2;
+// if (((Editable) (!) focus).get_selection_bounds (out garbage1, out garbage2))
+// {
+// ((Editable) (!) focus).copy_clipboard ();
+// return;
+// }
+// }
+// else if ((!) focus is TextView)
+// {
+// if (((TextView) (!) focus).get_buffer ().get_has_selection ())
+// {
+// ((TextView) (!) focus).copy_clipboard ();
+// return;
+// }
+// }
+// else if ((!) focus is Label)
+// {
+// int garbage1, garbage2;
+// if (((Label) (!) focus).get_selection_bounds (out garbage1, out garbage2))
+// {
+// ((Label) (!) focus).copy_clipboard ();
+// return;
+// }
+// }
+// }
+
+// main_view.close_popovers ();
+
+// string text;
+// if (handle_copy_text (out text))
+// copy_text (text);
}
private void copy_alt (/* SimpleAction action, Variant? path_variant */)
@@ -245,11 +245,11 @@ private class BaseWindow : AdaptativeWindow, AdaptativeWidget
Widget? focus = get_focus ();
if (focus != null)
{
- if ((!) focus is Entry)
- {
- ((Entry) (!) focus).paste_clipboard ();
- return;
- }
+// if ((!) focus is Entry)
+// {
+// ((Entry) (!) focus).paste_clipboard ();
+// return;
+// }
if ((!) focus is TextView)
{
((TextView) (!) focus).paste_clipboard ();
@@ -280,14 +280,14 @@ private class BaseWindow : AdaptativeWindow, AdaptativeWidget
private static inline bool get_clipboard_content (out string? clipboard_content)
{
- Gdk.Display? display = Gdk.Display.get_default ();
- if (display == null) // ?
- {
- clipboard_content = null; // garbage
- return false;
- }
+// Gdk.Display? display = Gdk.Display.get_default ();
+// if (display == null) // ?
+// {
+// clipboard_content = null; // garbage
+// return false;
+// }
- clipboard_content = Clipboard.get_default ((!) display).wait_for_text ();
+// clipboard_content = Clipboard.get_default ((!) display).wait_for_text ();
return true;
}
diff --git a/src/iagno.vala b/src/iagno.vala
index 2e772b4..79f3d03 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -1063,12 +1063,12 @@ private class Iagno : Gtk.Application, BaseApplication
internal void copy (string text)
{
- Gdk.Display? display = Gdk.Display.get_default ();
- if (display == null)
- return;
+// Gdk.Display? display = Gdk.Display.get_default ();
+// if (display == null)
+// return;
- Gtk.Clipboard clipboard = Gtk.Clipboard.get_default ((!) display);
- clipboard.set_text (text, text.length);
+// Gtk.Clipboard clipboard = Gtk.Clipboard.get_default ((!) display);
+// clipboard.set_text (text, text.length);
}
/*\
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]