~3v1n0/unity/gnome-keys-timestamp-api

« back to all changes in this revision

Viewing changes to UnityCore/IndicatorEntry.cpp

  • Committer: CI Train Bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2015-02-19 19:33:36 UTC
  • mfrom: (3899.2.85 lim-everywhere)
  • Revision ID: ci-train-bot@canonical.com-20150219193336-1ax9aswzdijrfq0f
Decorations, Panel: add menus for unfocused windows as well

Now the indicator-appmenu exports the menus for all the windows,
then it's up to us to filter them based on their parent window and
show on relevant place.
Also, set LIM as default now. Fixes: #1309778
Approved by: Andrea Azzarone, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
Entry::Entry(std::string const& id,
32
32
             std::string const& name_hint,
 
33
             uint32_t parent_window,
33
34
             std::string const& label,
34
35
             bool label_sensitive,
35
36
             bool label_visible,
40
41
             int priority)
41
42
  : id_(id)
42
43
  , name_hint_(name_hint)
 
44
  , parent_window_(parent_window)
43
45
  , label_(label)
44
46
  , label_visible_(label_visible)
45
47
  , label_sensitive_(label_sensitive)
52
54
  , active_(false)
53
55
{}
54
56
 
55
 
Entry::Entry(std::string const& id, std::string const& name_hint)
 
57
Entry::Entry(std::string const& id, std::string const& name_hint, uint32_t parent_window)
56
58
  : id_(id)
57
59
  , name_hint_(name_hint)
 
60
  , parent_window_(parent_window)
58
61
  , label_visible_(false)
59
62
  , label_sensitive_(false)
60
63
  , image_type_(0)
65
68
  , active_(false)
66
69
{}
67
70
 
 
71
std::string const& Entry::id() const
 
72
{
 
73
  return id_;
 
74
}
 
75
 
68
76
std::string const& Entry::name_hint() const
69
77
{
70
78
  return name_hint_;
71
79
}
72
80
 
73
 
std::string const& Entry::id() const
 
81
uint32_t Entry::parent_window() const
74
82
{
75
 
  return id_;
 
83
  return parent_window_;
76
84
}
77
85
 
78
86
std::string const& Entry::label() const
199
207
 
200
208
  id_ = rhs.id_;
201
209
  name_hint_ = rhs.name_hint_;
 
210
  parent_window_ = rhs.parent_window_;
202
211
  label_ = rhs.label_;
203
212
  label_sensitive_ = rhs.label_sensitive_;
204
213
  label_visible_ = rhs.label_visible_;
258
267
 
259
268
void Entry::ShowMenu(int x, int y, unsigned button)
260
269
{
261
 
  ShowMenu(0, x, y, button);
 
270
  ShowMenu(parent_window_, x, y, button);
262
271
}
263
272
 
264
273
void Entry::ShowMenu(unsigned int xid, int x, int y, unsigned button)
278
287
 
279
288
std::ostream& operator<<(std::ostream& out, Entry const& e)
280
289
{
281
 
  out << "<indicator::Entry " << e.id() << " hint: '" << e.name_hint() << "' "
 
290
  out << "<indicator::Entry " << e.id() << " hint: '" << e.name_hint() << "'"
 
291
      << " parent window: " << e.parent_window()
282
292
      << std::boolalpha
283
293
      << " \"" << e.label() << "\" ("
284
294
      << e.label_sensitive() << ", " << e.label_visible() << ") image ("