]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkdnd.c
Drop the Motif DND protocol
[~andy/gtk] / gtk / gtkdnd.c
index f77cc7ea0cf25c1b07bdac139d355873466c563a..2431f982569f691ec8ee59fdaf625a0c74d4795e 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -187,8 +185,6 @@ typedef gboolean (* GtkDragDestCallback) (GtkWidget      *widget,
 /* Enumeration for some targets we handle internally */
 
 enum {
-  TARGET_MOTIF_SUCCESS = 0x40000000,
-  TARGET_MOTIF_FAILURE,
   TARGET_DELETE
 };
 
@@ -362,7 +358,7 @@ gtk_drag_get_ipc_widget_for_screen (GdkScreen *screen)
       result = gtk_window_new (GTK_WINDOW_POPUP);
       gtk_window_set_screen (GTK_WINDOW (result), screen);
       gtk_window_resize (GTK_WINDOW (result), 1, 1);
-      gtk_window_move (GTK_WINDOW (result), -100, -100);
+      gtk_window_move (GTK_WINDOW (result), -99, -99);
       gtk_widget_show (result);
     }  
 
@@ -413,6 +409,18 @@ root_key_filter (GdkXEvent *xevent,
   if ((ev->type == KeyPress || ev->type == KeyRelease) &&
       ev->xkey.root == ev->xkey.window)
     ev->xkey.window = (Window)data;
+  else if (ev->type == GenericEvent)
+    {
+      XGenericEventCookie *cookie;
+      XIDeviceEvent *dev;
+
+      cookie = &ev->xcookie;
+      dev = (XIDeviceEvent *) cookie->data;
+
+      if (dev->evtype == XI_KeyPress ||
+          dev->evtype == XI_KeyRelease)
+        dev->event = (Window)data;
+    }
 
   return GDK_FILTER_CONTINUE;
 }
@@ -1190,12 +1198,6 @@ gtk_drag_finish (GdkDragContext *context,
     {
       target = gdk_atom_intern_static_string ("DELETE");
     }
-  else if (gdk_drag_context_get_protocol (context) == GDK_DRAG_PROTO_MOTIF)
-    {
-      target = gdk_atom_intern_static_string (success ? 
-                                             "XmTRANSFER_SUCCESS" : 
-                                             "XmTRANSFER_FAILURE");
-    }
 
   if (target != GDK_NONE)
     {
@@ -1771,8 +1773,6 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
        else if (event->type == GDK_DROP_START && !info->proxy_source)
          {
            gdk_drop_reply (context, found, event->dnd.time);
-            if ((gdk_drag_context_get_protocol (context) == GDK_DRAG_PROTO_MOTIF) && !found)
-             gtk_drag_finish (context, FALSE, FALSE, event->dnd.time);
          }
       }
       break;
@@ -3565,7 +3565,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
                  {
                    gboolean result = gdk_drag_context_get_selected_action (context) != 0;
                    
-                   /* Aha - we can finally pass the MOTIF DROP on... */
+                   /* Aha - we can finally pass the DROP on... */
                    gdk_drop_reply (info->proxy_dest->context, result, info->proxy_dest->proxy_drop_time);
                    if (result)
                      gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time);
@@ -3653,18 +3653,6 @@ gtk_drag_source_check_selection (GtkDragSourceInfo *info,
                                pair->info);
       tmp_list = tmp_list->next;
     }
-  
-  if (gdk_drag_context_get_protocol (info->context) == GDK_DRAG_PROTO_MOTIF)
-    {
-      gtk_selection_add_target (info->ipc_widget,
-                               selection,
-                               gdk_atom_intern_static_string ("XmTRANSFER_SUCCESS"),
-                               TARGET_MOTIF_SUCCESS);
-      gtk_selection_add_target (info->ipc_widget,
-                               selection,
-                               gdk_atom_intern_static_string ("XmTRANSFER_FAILURE"),
-                               TARGET_MOTIF_FAILURE);
-    }
 
   gtk_selection_add_target (info->ipc_widget,
                            selection,
@@ -3912,14 +3900,6 @@ gtk_drag_selection_get (GtkWidget        *widget,
                             info->context);
       gtk_selection_data_set (selection_data, null_atom, 8, NULL, 0);
       break;
-    case TARGET_MOTIF_SUCCESS:
-      gtk_drag_drop_finished (info, GTK_DRAG_RESULT_SUCCESS, time);
-      gtk_selection_data_set (selection_data, null_atom, 8, NULL, 0);
-      break;
-    case TARGET_MOTIF_FAILURE:
-      gtk_drag_drop_finished (info, GTK_DRAG_RESULT_NO_TARGET, time);
-      gtk_selection_data_set (selection_data, null_atom, 8, NULL, 0);
-      break;
     default:
       if (info->proxy_dest)
        {