aboutsummaryrefslogtreecommitdiff
path: root/dw/selection.hh
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2025-05-07 23:54:32 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2025-05-08 00:00:32 +0200
commitd901d8b641c88f9f22b0479d4b3326b2ed06e958 (patch)
tree5e43ce0b923368457215651b2a1eb68921e275a2 /dw/selection.hh
parent1e5da933a4ef2c5de8ca711215918e9f3ff9df3e (diff)
Make Ctrl+C copy selection into clipboard
Follows the behavior of so many other programs by copying the current text selection into the clipboard with Ctrl+C. Selecting text continues to copy it into the primary selection. Fixes: https://github.com/dillo-browser/dillo/issues/228
Diffstat (limited to 'dw/selection.hh')
-rw-r--r--dw/selection.hh23
1 files changed, 21 insertions, 2 deletions
diff --git a/dw/selection.hh b/dw/selection.hh
index d9d5af72..11ac96e6 100644
--- a/dw/selection.hh
+++ b/dw/selection.hh
@@ -1,3 +1,23 @@
+/*
+ * Dillo Widget
+ *
+ * Copyright 2005-2007 Sebastian Geerken <sgeerken@dillo.org>
+ * Copyright 2025 Rodrigo Arias Mallo <rodarima@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#ifndef __DW_SELECTION_H__
#define __DW_SELECTION_H__
@@ -214,8 +234,6 @@ private:
void highlight0 (bool fl, DeepIterator *from, int fromChar,
DeepIterator *to, int toChar, int dir);
- void copy ();
-
public:
enum EventType { BUTTON_PRESS, BUTTON_RELEASE, BUTTON_MOTION };
@@ -224,6 +242,7 @@ public:
inline void setLayout (Layout *layout) { this->layout = layout; }
void reset ();
+ void copy (int selection);
bool buttonPress (Iterator *it, int charPos, int linkNo,
EventButton *event);
bool buttonRelease (Iterator *it, int charPos, int linkNo,