1. 28 Apr, 2014 1 commit
    • Allison Karlitskaya's avatar
      GtkMenuTracker: don't specialise "submenu" link · f6ee0076
      Allison Karlitskaya authored
      We have some API in GtkMenuTracker and GtkMenuTrackerItem that is
      specifically designed to deal with submenus.
      
      Generalise these APIs to take a 'link_name' parameter that we always
      give as G_MENU_SUBMENU for now.  In the future, this will allow creating
      trackers for other types of links, such as sections.
      f6ee0076
  2. 03 Mar, 2014 1 commit
  3. 07 Feb, 2014 3 commits
  4. 05 Feb, 2014 2 commits
  5. 02 Feb, 2014 1 commit
  6. 21 Jan, 2014 1 commit
  7. 18 Jan, 2014 1 commit
  8. 13 Jan, 2014 1 commit
    • Matthias Clasen's avatar
      Redo csd window-dragging · 2232430a
      Matthias Clasen authored
      The window-dragging code had a number of issues: The code was
      starting a drag on every button press, never bothering to cancel
      them. This leads to the odd hand cursor occurring between the two
      clicks to maximize. We relied on GDK's multi-click detection, which
      gives us triple-clicks when we really want sequences of double-clicks.
      Lastly, we didn't propery restrict double-click handling to the primary
      button, so e.g. if you had a window on an empty workspace, double-right
      click on the titlebar would maximize it, which is not intended.
      
      This commit solves all three problem by a doing our own double-click
      detection, and only starting a drag when the pointer goes out of
      'double-click range'. We change the way dragging is implemented for
      menubars and toolbars to just letting events bubble up, so they
      get the same behaviour as the titlebar. To make this work, we
      have to select for pointer motion events in a few more places.
      2232430a
  9. 04 Jan, 2014 1 commit
  10. 09 Nov, 2013 1 commit
  11. 14 Aug, 2013 1 commit
  12. 09 Jul, 2013 1 commit
  13. 27 Jun, 2013 1 commit
  14. 26 Jun, 2013 3 commits
  15. 24 Jun, 2013 1 commit
    • Allison Karlitskaya's avatar
      menu model: set separator label conditionally · c79a21e1
      Allison Karlitskaya authored
      When creating separators we were binding the "label" property on the
      tracker to the "label" property on the GtkSeparatorMenuItem.
      
      This was problematic for two reasons.
      
      First, it was pointless.  The section header label will never change.
      
      Second, it was causing problems: doing the binding caused the value to
      be initially synced up, even if it was NULL.  Doing this caused
      GtkMenuItem to create a GtkAccelLabel and add it as a child, which
      prevented the separator from being shown normally.
      
      Change the code a bit so that we just call gtk_menu_item_set_label()
      when creating the item, if we find the label to be non-NULL.
      
      Also, show() the separator item at first.  GtkMenu manages visibility of
      separators internally, but it seems "more correct" to show it ourselves
      at first.
      c79a21e1
  16. 22 Jun, 2013 1 commit
  17. 13 May, 2013 1 commit
    • Allison Karlitskaya's avatar
      add GtkMenuTrackerItem · a4276a6c
      Allison Karlitskaya authored
      Add a new class, GtkMenuTrackerItem that represents a menu item, to be
      used with GtkMenuTracker.
      
      GtkMenuTracker's insert callback now works in terms of this new type
      (instead of passing reference to the model and an index to the item).
      
      GtkMenuShell now handles all of the binding tasks internally, mostly
      through the use of property bindings.  Having bindings for the label and
      visibility attributes, in partiular, will help with supporting upcoming
      extensions to GMenuModel.
      
      GtkModelMenu has been reduced to a helper class that has nothing to do
      with GMenuModel.  It represents something closer to an "ideal" API for
      GtkMenuItem if we didn't have compatibility concerns (eg: not emitting
      "activate" when setting toggle state, no separate subclasses per menu
      item type, supporting icons, etc.) Improvements to GtkMenuItem could
      eventually shrink the size of this class or remove the need for it
      entirely.
      
      Some GtkActionHelper functionality has been duplicated in
      GtkMenuTracker, which is suboptimal.  The duplication exists so that
      other codebases (such as Unity and gnome-shell) can reuse the
      GtkMenuTracker code, whereas GtkActionHelper is very much tied to
      GtkWidget.  Supporting binding arbitrary GtkWidgets to actions vs.
      supporting the full range of GMenuModel features for menu items turns
      out to be two overlapping but not entirely similar problems.  Some of
      the duplication (such as roles) can be removed from GtkActionHelper once
      Gtk's internal Mac OS menubar support is ported to GtkMenuTracker.
      
      The intent to reuse the code outside of Gtk is also the reason for the
      unusual treatment of the enum type introduced in this comment.
      
      This adds no new "public" API to the Gtk library, other than types that
      we cannot make private due to GType limitations.
      a4276a6c
  18. 05 May, 2013 1 commit
  19. 18 Apr, 2013 1 commit
    • Allison Karlitskaya's avatar
      menu binding docs: Link to insert_action_group() · a37ddbe7
      Allison Karlitskaya authored
      It's pretty useless to make a menu without actions behind it and people
      who are using gtk_menu_shell_bind_model() directly are probably not
      interested in doing it the GtkApplicationWindow way (so they won't get
      the "app" and "win" groups for free).  People are going to need to call
      gtk_widget_insert_action_group(), so mention this in the docs to help
      them along.
      a37ddbe7
  20. 01 Apr, 2013 1 commit
    • Allison Karlitskaya's avatar
      Introduce GtkMenuTracker · 5617b584
      Allison Karlitskaya authored
      GtkMenuTracker folds a nested structure of sections in a GMenuModel into
      a single linear menu, which it expresses to its user by means of 'insert
      item at position' and 'remove item at position' callbacks.
      
      The logic for where to insert separators and how to handle action
      namespaces is contained within the tracker, removing the need to have
      this logic duplicated in the 3 or 4 places that consume GMenuModel.
      
      In comparison with the previous code, the tracker no longer completely
      destroys and rebuilds menus every time a single change occurs.  As a
      result, the new gtkmenu testcase now runs in approximately 3 seconds
      instead of ~60 before.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=696468
      5617b584
  21. 28 Mar, 2013 1 commit
  22. 07 Feb, 2013 1 commit
    • Alexander Larsson's avatar
      Add gtk_widget_(un)register_window · 3d4cd4db
      Alexander Larsson authored
      This replaces the previously hardcoded calls to gdk_window_set_user_data,
      and also lets us track which windows are a part of a widget. Old code
      should continue working as is, but new features that require the
      windows may not work perfectly.
      
      We need this for the transparent widget support to work, as we need
      to specially mark the windows of child widgets.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=687842
      3d4cd4db
  23. 17 Dec, 2012 2 commits
  24. 30 Nov, 2012 1 commit
  25. 01 Mar, 2012 2 commits
  26. 29 Feb, 2012 1 commit
  27. 27 Feb, 2012 1 commit
  28. 16 Nov, 2011 1 commit
  29. 11 Nov, 2011 1 commit
  30. 02 Nov, 2011 2 commits
  31. 23 Oct, 2011 1 commit
  32. 01 Oct, 2011 1 commit