<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40679 >

Somehow it became impossible to copy production to the clipboard
using the gtk2 client. This patch re-enables that feature; the
mouse key sequences are:

shift + ctrl + rmb: Paste production.
shift + rmb: Copy production.

In trunk the former sequence is used to toggle worker overlays;
it is changed to shift + alt + rmb.


-----------------------------------------------------------------------
長い間いる必要になるなら、食物は足りますか。
diff --git a/client/gui-gtk-2.0/mapctrl.c b/client/gui-gtk-2.0/mapctrl.c
index 150fe1f..2d1414b 100644
--- a/client/gui-gtk-2.0/mapctrl.c
+++ b/client/gui-gtk-2.0/mapctrl.c
@@ -290,15 +290,20 @@ gboolean butt_down_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data)
 
   case 3: /* RIGHT mouse button */
 
-    /* <CONTROL> + RMB : Quickselect a land unit. */
-    if (ev->state & GDK_CONTROL_MASK) {
-      action_button_pressed(ev->x, ev->y, SELECT_LAND);
-    }
-    /* <SHIFT> + RMB: Paste Production. */
-    else if ((ev->state & GDK_SHIFT_MASK) && pcity) {
+    /* <SHIFT + CONTROL> + RMB: Paste Production. */
+    if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_CONTROL_MASK)
+        && pcity != NULL) {
       clipboard_paste_production(pcity);
       cancel_tile_hiliting();
     }
+    /* <SHIFT> + RMB: Copy Production. */
+    else if (ev->state & GDK_SHIFT_MASK) {
+      clipboard_copy_production(ptile);
+    }
+    /* <CONTROL> + RMB : Quickselect a land unit. */
+    else if (ev->state & GDK_CONTROL_MASK) {
+      action_button_pressed(ev->x, ev->y, SELECT_LAND);
+    }
     /* Plain RMB click. */
     else {
       /*  A foolproof user will depress button on canvas,
diff --git a/client/gui-gtk-2.0/mapctrl.c b/client/gui-gtk-2.0/mapctrl.c
index d87cc54..f2ffeb6 100644
--- a/client/gui-gtk-2.0/mapctrl.c
+++ b/client/gui-gtk-2.0/mapctrl.c
@@ -301,23 +301,25 @@ gboolean butt_down_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data)
 
   case 3: /* RIGHT mouse button */
 
-    /* <SHIFT> + <CONTROL> + RMB : Show/hide workers. */
-    if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_CONTROL_MASK)) {
-      if (NULL != pcity) {
-        overlay_workers_at_city();
-      }
+    /* <SHIFT> + <ALT> + RMB : Show/hide workers. */
+    if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_MOD1_MASK)
+        && pcity != NULL) {
+      overlay_workers_at_city();
+    }
+    /* <SHIFT + CONTROL> + RMB: Paste Production. */
+    else if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_CONTROL_MASK)
+             && pcity != NULL) {
+      clipboard_paste_production(pcity);
+      cancel_tile_hiliting();
+    }
+    /* <SHIFT> + RMB: Copy Production. */
+    else if (ev->state & GDK_SHIFT_MASK) {
+      clipboard_copy_production(ptile);
     }
     /* <CONTROL> + RMB : Quickselect a land unit. */
     else if (ev->state & GDK_CONTROL_MASK) {
       action_button_pressed(ev->x, ev->y, SELECT_LAND);
     }
-    /* <SHIFT> + RMB: Paste Production. */
-    else if ((ev->state & GDK_SHIFT_MASK)) {
-      if (NULL != pcity) {
-        clipboard_paste_production(pcity);
-        cancel_tile_hiliting();
-      }
-    }
     /* Plain RMB click. */
     else {
       /*  A foolproof user will depress button on canvas,
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to