1. 11 Feb, 2018 2 commits
  2. 25 Nov, 2017 1 commit
    • LRN's avatar
      W32: Massive W32 DnD fix · 8caba953
      LRN authored
      Massive changes to OLE2 DnD protocol, which was completely broken before:
      * Keep GdkDragContext and OLE2 objects separate (don't ref/unref them
        together, don't necessarily create them together).
      * Keep IDataObject formats in the object itself, not in a global variable.
      * Fix getdata() to look up the request target in its format list, not in the
        global hash table
      * Create target GdkDragContext on each drag_enter, destroy it on drag_leave,
        whereas IDropTarget is created when a window becomes a drag destination
        and is re-used indefinitely.
      * Query the source IDataObject for its supported types, cache them in the
        target (!) context. This is how GTK+ works, honestly.
      * Remember current_src_object when we initiate a drag, to be able
        to detect later on that the data object is ours and use a
        shortcut when querying targets
      * Make sure GDK_DRAG_MOTION is only sent when something changes
      * Support GTK drag cursors
      * Ensure that exotic GTK clipboard formats are registered
        (but try to avoid registering formats that can't be used between applications).
      * Don't enumerate internal formats
      * Ensure that DnD indicator window can't accept drags or receive any kind of input
        (use WS_EX_TRANSPARENT).
      * Remove unneeded indentation in _gdk_win32_dnd_do_dragdrop()
      * Fix indentation in gdk_win32_drag_context_drop_finish()
      * Remove obsolete comments in _gdk_win32_window_register_dnd()
      * Check for DnD in progress when processing WM_KILLFOCUS, don't emit a grab
        break event in such cases (this allows alt-tabbing while DnD is in progress,
        though there may be lingering issues with focus after dropping...)
      * Support Shell ID List -> text/uri-list conversion, now it's possible
        to drop files (dragged from Explorer) on GTK+ applications
      * Explicitly use RegisterClipboardFormatA() when we know that the string
        is not in unicode. Otherwise explicitly use RegisterClipboardFormatW()
        with a UTF8->UTF16 converted string
      * Fix _gdk_win32_display_get_selection_owner() to correctly bail
        when selection owner HWND is NULL (looking up GdkWindow for NULL
        HWND always succeeds and returns the root window - not the intended
        effect)
      * More logging
      * Send DROP_FINISHED event after DnD loop ends
      * Send STATUS event on feedback
      * Move GetKeyboardState() and related code into _gdk_win32_window_drag_begin(),
        so that it's closer to the point where last_pt and start_pt are set
      * Use & 0x80 to check for the key being pressed. Windows will set low-order bit
        to 1 for all mouse buttons to indicate that they are toggled, so simply
        checking for the value not being 0 is not enough anymore.
        This is probably a new thing in modern W32 that didn't exist before
        (OLE2 DnD code is old).
      * Fixed (hopefully) and simplified HiDPI parts of the code.
      
      Also adds managed DnD implementation for W32 GDK backend (for both
      OLE2 and LOCAL protocols). Mostly a copy of the X11 backend code, but
      there are some minor differences:
      * doesn't use drag_window field in GdkDragContext,
        uses the one in GdkWin32DragContext exclusively
      * subtracts hotspot offset from the window coordinates when showing
        the dragback animation
      * tries to consistently support scaling and caches the scale
        in the context
      * Some keynav code is removed (places where grabbing/ungrabbing should
        happen is marked with TODOs), and the rest is probably inert.
      
      Also significantly changes the way selection (and clipboard) is handled
      (as MSDN rightly notes, the handling for DnD and Clipboard
       formats is virtually the same, so it makes sense to handle
       both with the same code):
      * Don't spam GDK_OWNER_CHANGE, send them only when owner
        actually changes
      * Open clipboard when our process becomes the clipboard owner
        (we are doing it anyway, to empty the clipboard and *become* the owner),
        and then don't close it until a scheduled selection request event
        (with TARGETS target) is received. Process that event by announcing
        all of our supported formats (by that time add_targets() should have
        been called up the stack, thus the formats are known; just in case,
        add_targets() will also schedule a selection request, if one isn't
        scheduled already, so that late-coming formats can still be announced).
      * Allow clipboard opening for selection_convert() to be delayed if it
        fails initially.
      * The last two points above should fix all the bugs about GTK+ rising
        too much ruckus over OpenClipboard() failures, as owner change
        *is allowed* to fail (though not all callers currently handle
        that case), and selection_convert() is asynchronous to begin with.
        Still, this is somewhat risky, as there's a possibility that the
        code will work in unexpected ways and the clipboard will remain open.
        There's now logging to track the clipboard being opened and closed,
        and a number of failsafes that try to ensure that it isn't kept open
        for no reason.
      * Added copious notes on the way clipboard works on X11, Windows and GDK-W32,
        also removed old comments in DnD implementation, replaced some of them
        with the new ones
      * A lot of crufty module-global variables are stuffed into a singleton
        object, GdkWin32Selection. It's technically possible to make it a
        sub-object of the Display object (the way Wayland backend does),
        but since Display object on W32 is a singleton anyway... why bother?
      * Fixed the send_change_events() a bit (was slightly broken in one of the
        previous iterations)
      * Ensure that there's no confusion between selection conversion (an artifact
        term from X11) and selection transmutation (changing the data to be W32-compatible)
      * Put all the transmutation code and format-target-matching code into gdkselection-win32.c,
        now this code isn't spread across multiple files.
      * Consequently, moved some code away from gdkproperty-win32.c and gdkdnd-win32.c
      * Extensive format transmutation checks for OLE2 DnD and clipboard.
        We now keep track of which format mappings are for transmutations,
        and which aren't (for example, when formats are passed as-is, or when
        a registered name is just an alias)
      * Put transmutation code into separate functions
      
      * Ensure that drop target keeps a format->target map for supported formats,
        this is useful when selection_convert() is called, as it only receives a
        single target and no hints on the format from which the data should
        be transmuted into this target.
      * Add clear_targets() on W32, to de called by GTK
      * Use g_set_object() instead of g_ref_object() where it is allowed.
      * Fix indentation (and convert tabs to spaces), remove unused variables
      
      https://bugzilla.gnome.org/show_bug.cgi?id=786509
      8caba953
  3. 22 Nov, 2017 1 commit
  4. 05 May, 2017 1 commit
  5. 09 Jan, 2017 1 commit
  6. 01 May, 2016 2 commits
  7. 27 Apr, 2016 2 commits
    • Matthias Clasen's avatar
      dnd: Fix some issues with drag icons · 1d35f273
      Matthias Clasen authored
      In non-composited environments, we were ending up with all-black
      drag icons, because nothing was drawing the background of our new
      toplevel. Fix this by drawing background when we are not composited.
      We don't do this when composited, since we want to allow transparent
      icons.
      1d35f273
    • Matthias Clasen's avatar
      dnd: Fix lifecycle issues with widgets as drag icons · c27c4e20
      Matthias Clasen authored
      The documentation clearly says that the widget is not destroyed,
      but we were in fact failing to keep it alive, since it was still
      a child or the icon_window when we destroy that. Fix this by
      reparenting the icon_widget out before. Also, deal with the
      possibility that the application might destroy the widget
      halfway through, for whatever reason.
      c27c4e20
  8. 25 Mar, 2016 1 commit
  9. 21 Feb, 2016 1 commit
  10. 15 Feb, 2016 1 commit
  11. 28 Jan, 2016 1 commit
    • Carlos Garnacho's avatar
      gtkdnd: Fix deprecation compile warnings · 0125aa0a
      Carlos Garnacho authored
      Grabbing must stay a bit longer until all other backends than x11/wayland
      catch up with GDK DnD, so ignore deprecation flags are used on those. The
      uses of GdkDeviceManager can be entirely avoided though.
      0125aa0a
  12. 20 Jan, 2016 1 commit
  13. 19 Jan, 2016 3 commits
  14. 11 Jan, 2016 1 commit
  15. 08 Jan, 2016 2 commits
    • Matthias Clasen's avatar
      Use standard cursor names for DND · 4b7c8218
      Matthias Clasen authored
      At least as far as we have them. CSS has on equivalent of dnd-ask,
      so we keep using that name as-is.
      4b7c8218
    • Alberto Ruiz's avatar
      introspection: This patch fixes nullable return values fixes for the following symbols in gtk · 496f0892
      Alberto Ruiz authored
        gtk_accel_group_query
        gtk_accel_group_from_accel_closure
        gtk_accel_label_get_accel_widget
        gtk_accessible_get_widget
        gtk_actionable_get_action_name
        gtk_app_chooser_get_app_info
        gtk_app_chooser_button_get_heading
        gtk_app_chooser_dialog_get_heading
        gtk_application_get_window_by_id
        gtk_assistant_get_nth_page
        gtk_binding_set_find
        gtk_builder_get_object
        gtk_builder_lookup_callback_symbol
        gtk_builder_get_application
        gtk_button_get_image
        gtk_cell_area_get_focus_from_sibling
        gtk_cell_renderer_start_editing
        gtk_cell_view_get_model
        gtk_cell_view_get_displayed_row
        gtk_clipboard_get_owner
        gtk_container_get_focus_child
        gtk_container_get_focus_vadjustment
        gtk_container_get_focus_hadjustment
        gtk_dialog_get_widget_for_response
        gtk_drag_get_source_widget
        gtk_drag_dest_get_target_list
        gtk_drag_source_get_target_list
        gtk_entry_completion_get_model
        gtk_entry_completion_compute_prefix
        gtk_expander_get_label_widget
        gtk_file_chooser_get_filename
        gtk_file_chooser_get_current_folder
        gtk_file_chooser_get_uri
        gtk_file_chooser_get_current_folder_uri
        gtk_file_chooser_get_preview_widget
        gtk_file_chooser_get_preview_file
        gtk_file_chooser_get_preview_filename
        gtk_file_chooser_get_preview_uri
        gtk_file_chooser_get_extra_widget
        gtk_file_chooser_get_filter
        gtk_file_chooser_native_get_accept_label
        gtk_file_chooser_native_get_cancel_label
        gtk_file_filter_get_name
        gtk_font_chooser_get_font_family
        gtk_font_chooser_get_font_face
        gtk_font_chooser_get_font
        gtk_font_chooser_get_font_desc
        gtk_font_chooser_get_font_map
        gtk_frame_get_label
        gtk_gesture_get_device
        gtk_gesture_get_window
        gtk_gl_area_get_error
        gtk_header_bar_get_title
        gtk_header_bar_get_subtitle
        gtk_header_bar_get_custom_title
        gtk_icon_info_get_filename
        gtk_icon_view_get_path_at_pos
        gtk_icon_view_get_model
        gtk_image_get_pixbuf
        gtk_image_get_animation
        gtk_label_get_mnemonic_widget
        gtk_label_get_attributes
        gtk_check_version
        gtk_menu_button_get_popup
        gtk_menu_button_get_menu_model
        gtk_menu_button_get_align_widget
        gtk_menu_button_get_popover
        gtk_menu_item_get_submenu
        gtk_menu_item_get_accel_path
        gtk_native_dialog_get_title
        gtk_native_dialog_get_transient_for
        gtk_notebook_get_nth_page
        gtk_notebook_get_tab_label_text
        gtk_notebook_get_menu_label
        gtk_notebook_get_menu_label_text
        gtk_notebook_get_group_name
        gtk_notebook_get_action_widget
        gtk_offscreen_window_get_surface
        gtk_offscreen_window_get_pixbuf
        gtk_paned_get_child1
        gtk_paned_get_child2
        gtk_places_sidebar_get_location
        gtk_places_sidebar_get_nth_bookmark
        gtk_plug_get_socket_window
        gtk_popover_get_default_widget
        gtk_progress_bar_get_text
        gtk_recent_filter_get_name
        gtk_recent_manager_lookup_item
        gtk_settings_get_default
        gtk_socket_get_plug_window
        gtk_stack_sidebar_get_stack
        gtk_stack_switcher_get_stack
        gtk_style_context_get_section
        gtk_style_context_get_parent
        gtk_style_context_get_frame_clock
        gtk_test_find_widget
        gtk_text_buffer_get_mark
        gtk_text_tag_table_lookup
        gtk_text_view_get_tabs
        gtk_text_view_toggle_cursor_visible
        gtk_text_view_get_window
        gtk_toolbar_get_nth_item
        gtk_tool_button_get_label
        gtk_tool_button_get_icon_name
        gtk_tool_button_get_label_widget
        gtk_tool_button_get_icon_widget
        gtk_tool_palette_get_drop_item
        gtk_tool_palette_get_drop_group
        gtk_tree_model_filter_convert_child_path_to_path
        gtk_tree_model_filter_convert_path_to_child_path
        gtk_tree_model_sort_convert_child_path_to_path
        gtk_tree_model_sort_convert_path_to_child_path
        gtk_tree_view_get_column
        gtk_tree_view_get_bin_window
        gtk_tree_view_column_get_widget
        gtk_tree_view_column_get_tree_view
        gtk_widget_get_frame_clock
        gtk_window_group_get_current_device_grab
        GtkTextBufferSerializeFunc
      496f0892
  16. 26 Dec, 2015 1 commit
    • Matthias Clasen's avatar
      Use CSS syntax for drop highlighting · 158dbbc8
      Matthias Clasen authored
      I hadn't noticed the :drop() pseudo state in the CSS4 Selectors
      spec when I added this a while ago. This commit renames
      GTK_STATE_FLAG_DND to GTK_STATE_FLAG_DROP_ACTIVE and adds
      :drop(active) as equivalent to the :dnd pseudo state.
      158dbbc8
  17. 15 Dec, 2015 1 commit
  18. 13 Dec, 2015 3 commits
    • Matthias Clasen's avatar
      dnd: Cleanups · a22c1ec9
      Matthias Clasen authored
      Remove some now unused includes and dead code, and rename
      gtk_drag_set_icon_window to gtk_drag_set_icon_widget_internal,
      since it is no longer restricted to toplevel windows.
      a22c1ec9
    • Matthias Clasen's avatar
      dnd: Stop doing cancel animation in GTK+ · 95f64814
      Matthias Clasen authored
      Under Wayland, the compositor does it, so there is no need
      for us to move the window ourselves. For X11, we are now
      doing the animation from the X11 backend. Trigger that by
      calling gdk_drag_drop_done().
      
      What changes here is that we have to keep the icon_window
      alive for as long as the drag context exists. Use a weak
      reference to do so.
      95f64814
    • Matthias Clasen's avatar
      dnd: Pass start coordinates when creating the drag context · a24bbcbb
      Matthias Clasen authored
      This will be used in subsequent commits.
      a24bbcbb
  19. 08 Dec, 2015 2 commits
  20. 03 Dec, 2015 2 commits
  21. 02 Dec, 2015 7 commits
  22. 01 Dec, 2015 3 commits