Commit Graph

452 Commits

Author SHA1 Message Date
Bastien Nocera
cd2bd7685a js: Name all the timeouts and idles
With very uninventive names. Names now, good names later.

https://bugzilla.gnome.org/show_bug.cgi?id=727983
2014-04-10 21:08:16 +02:00
Jasper St. Pierre
c675c93733 messageTray: Set the state to SHOWN when the notification is updated
If the notification is updated while SHOWING, we'll overwrite the
tween updating it to the new 'y' position, but forget to update the
state to SHOWN at the end of our transition. Make sure to always set
the state to SHOWN at the end.

https://bugzilla.gnome.org/show_bug.cgi?id=704844
2014-03-14 11:13:17 -04:00
Giovanni Campagna
057a026ea4 MessageTray: don't destroy notifications when the user presses ESC
Doing so is inconsistent with the behavior in the summary, and
is quite annoying when dealing with chats (because there is no way
to unfocus a chat notification with the keyboard only)

https://bugzilla.gnome.org/show_bug.cgi?id=724178
2014-03-12 19:33:35 +01:00
Adel Gadllah
b4ee86955d messageTray: Make sure that the source actor is square
Commit b7e1539699 removed the size to support hidpi but that caused the
actor to no longer be square. Fix that by going back to setting a size
but apply the scale factor before doing so.
2014-02-26 18:15:38 +01:00
Cosimo Cecchi
b7e1539699 messageTray: don't force a size on SourceActor's iconBin
Supports hidpi icons this way.

https://bugzilla.gnome.org/show_bug.cgi?id=724607
2014-02-18 07:46:54 -08:00
Carlos Soriano
598f750859 messageTray: Add source actor without count label
Split the current implementation of SourceActor into
SourceActor and SourceActorWithLabel.
In this manner we can use source actors withouth count labels,
required in the screenShield to not clash with the count
text label.

https://bugzilla.gnome.org/show_bug.cgi?id=709275
2014-02-17 13:22:39 +01:00
Giovanni Campagna
3227d4f3ed ShellApp+ShellGlobal: unify app launch context code
Extend shell_global_create_app_launch_context() with the required
parameters and use that for shell_app_launch() too.

https://bugzilla.gnome.org/show_bug.cgi?id=669603
2014-01-19 18:51:48 +01:00
Giovanni Campagna
5413010c60 Notification: don't expand the content on a destroyed notification
If the notification is destroyed between an allocate and the redraw,
the meta_later is invoked on a destroyed object, and fails because
the clutter calls are invalid at that point.

https://bugzilla.gnome.org/show_bug.cgi?id=722547
2014-01-19 15:59:18 +01:00
Giovanni Campagna
bfb0235fc6 Remove our custom hashmap implementation
gjs uses Spidermonkey 24, which implements Map from the ES6
specification, so we can use that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=722210
2014-01-15 00:55:00 +01:00
Florian Müllner
deb2f30b37 js: Use EVENT_PROPAGATE/EVENT_STOP constants in event handlers
Just as SOURCE_CONTINUE/SOURCE_REMOVE in source functions, these
constants increase code clarity over plain true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Florian Müllner
751a3f0e94 js: Use SOURCE_CONTINUE/SOURCE_REMOVE constants in source functions
With support for boolean constants in g-i, we can finally use the
more readable constants instead of true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Jasper St. Pierre
e34e681157 messageTray: Fix style 2013-12-05 01:32:28 -05:00
Jasper St. Pierre
acd543fe4b messageTray: Fix style
We're missing a semi here
2013-12-04 20:51:10 -05:00
Jasper St. Pierre
b52e74b615 messageTray: Remove transient sources
As far as I can tell, the only behavior change of a transient source
is that they auto-destroy after viewing their summary box pointer.
Since all transient sources are only associated with transient
notifications, it seems that we can never get to their summary box
pointer in the first place! Remove support for this.

https://bugzilla.gnome.org/show_bug.cgi?id=710115
2013-12-04 20:25:28 -05:00
Jasper St. Pierre
c89af0cea4 messageTray: Only attempt to grab the summary box pointer after showing it
For mysterious reasons I'm not sure of myself, navigate_focus will only focus
mapped actors. So, make sure the widget is showing before navigating to it.

https://bugzilla.gnome.org/show_bug.cgi?id=709853
2013-12-04 11:22:55 -05:00
Jasper St. Pierre
9d3a109946 messageTray: Reword a boolean condition
Just so it's a bit easier to understand...
2013-12-04 11:22:55 -05:00
Jasper St. Pierre
079f1e6fff messageTray: Fix style 2013-12-04 11:22:55 -05:00
Jasper St. Pierre
87f0e79749 messageTray: Prevent reentrancy issues in _updateState
The methods we call in _updateState may not be reentrant, so make
sure that we never get into a situation where _updateState, through
some crazy chain of events, calls itself.

https://bugzilla.gnome.org/show_bug.cgi?id=711694
2013-11-17 12:06:38 -05:00
Jasper St. Pierre
fe05d35bbb messageTray: Fix style 2013-11-15 10:39:30 -05:00
Jasper St. Pierre
4ba8518462 messageTray: Use a regular tween when expanding the notification
When a notification becomes expanded, it's either already shown,
or in the process of being shown. Don't set the state to SHOWING
again, which confuses our state machine.
2013-11-04 14:25:29 -05:00
Jasper St. Pierre
143dfb6246 messageTray: Simplify code
If notificationRemoved, then mustClose is true, so we don't need to
double-check for this.
2013-11-04 14:16:28 -05:00
Florian Müllner
4b09d57ec2 Fix fallout from notification changes
Commit 5f081b8f8d moved code without moving a helper function
used.

https://bugzilla.gnome.org/show_bug.cgi?id=710596
2013-10-25 14:15:10 +01:00
Jasper St. Pierre
8ee0ef2cde messageTray: Don't always open the source when clicking on the notification
Some consumers may not always want to open the app, so make clients that
want to do this explicitly connect to the 'clicked' signal.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
2013-10-21 12:30:25 -04:00
Jasper St. Pierre
43f4682ec4 messageTray: Make addButton/addAction take a callback
This is a much simpler API for consumers to manage.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
2013-10-21 12:30:25 -04:00
Jasper St. Pierre
5f081b8f8d messageTray: Remove useActionIcons feature
This can be put in the legacy notification daemon with the new
addButtonFull API, to create icon names for actions.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
2013-10-21 12:30:25 -04:00
Jasper St. Pierre
5023542882 messageTray: Split out addButton to allow consumers to pass a pre-made button
Some consumers may want to construct their buttons specially, so allow them
to do that by adding a new API that takes a button instead of a label.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
2013-10-21 12:30:25 -04:00
Jasper St. Pierre
88d0731d80 messageTray: Replace setButtonSensitive by simply returning the button
We want to remove 'id's from buttons, and simply returning the button actor
is more powerful anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=710137
2013-10-21 12:30:25 -04:00
Jasper St. Pierre
f72f39bc26 messageTray: Only try to focus the summary when summoning the tray by <Super>M
Otherwise, when closing the tray, we'll try to focus an actor, which will
focus the stage window, which will drop the focus from whatever window we
already had focused.

https://bugzilla.gnome.org/show_bug.cgi?id=710347
2013-10-17 13:07:42 -04:00
Jasper St. Pierre
96aa33f4ef messageTray: Don't remove and re-add the focus group on button changes
https://bugzilla.gnome.org/show_bug.cgi?id=710115
2013-10-14 15:24:53 -04:00
Jasper St. Pierre
25fd23e703 messageTray: Split out the notification's destroy handler
This is complex enough to split out.

https://bugzilla.gnome.org/show_bug.cgi?id=710115
2013-10-14 15:24:53 -04:00
Jasper St. Pierre
99cf4e5787 messageTray: Only connect to a notification's open/destroy once
If we pushNotification the same notification multiple times, we
won't append it to the array again, but we will attach multiple
handlers needlessly.

https://bugzilla.gnome.org/show_bug.cgi?id=710115
2013-10-14 15:24:53 -04:00
Jasper St. Pierre
66a4cb5875 messageTray: Move the notification policy classes here
The NotificationDaemon really should be for the hookup of remote
notifications, rather than policies.

https://bugzilla.gnome.org/show_bug.cgi?id=710115
2013-10-14 15:24:53 -04:00
Jasper St. Pierre
da14e2c349 messageTray: Clean up code that determines if something is clearable
https://bugzilla.gnome.org/show_bug.cgi?id=710115
2013-10-14 15:24:53 -04:00
Giovanni Campagna
619389ed20 NotificationDaemon: fix icons for notifications without an app
NotificationDaemon doesn't pass a gicon to the Notification constructor,
because it calls .update() immediately after, so messageTray.js
calls into Source.createIcon(), which returns null and crashes.
Instead, shortcut the Notification constructor by skipping
.update() completely.

https://bugzilla.gnome.org/show_bug.cgi?id=709998
2013-10-13 01:23:18 +02:00
Florian Müllner
6e9a2fea89 messageTray: Add 'Notifications' switch to tray menu
According to the designs, the notifications switch was supposed
to move from the user menu to the new message tray menu. However
so far the new system status implementation only removed the old
switch, so add it back in its new place now.

https://bugzilla.gnome.org/show_bug.cgi?id=707073
2013-10-10 23:13:47 +02:00
Florian Müllner
c8a07dd612 messageTray: Fix condition for adding the tray to CtrlAltTab
With the current condition, we wrongly add the message tray to
CtrlAltTab if we start up locked or as greeter.

https://bugzilla.gnome.org/show_bug.cgi?id=708380
2013-09-23 13:32:17 +02:00
Giovanni Campagna
11c2933e23 ShellGlobal: remove cursor manipulation functions
Use the new API in MetaScreen instead, which is automatically
routed to MetaCursorTracker as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=707467
2013-09-12 10:34:22 +02:00
Florian Müllner
aa6471b3cc messageTray: Reset clickedSummaryItem on ungrab
If we don't, we will pop up the summary again the next time
_updateState() is called.

https://bugzilla.gnome.org/show_bug.cgi?id=707600
2013-09-06 10:16:37 +02:00
Giovanni Campagna
e0574d2861 Replace GnomeIdleMonitor with MetaIdleMonitor
Now that GnomeIdleMonitor is a DBus API for mutter, we need to
use own in-process thing, to avoid dead locks.

https://bugzilla.gnome.org/show_bug.cgi?id=706005
2013-08-23 16:22:44 +02:00
Giovanni Campagna
6b8339e9b4 Lightbox: have animation times passed as parameters to show() and hide()
This way it is possible to use the same lightbox with different
times.

https://bugzilla.gnome.org/show_bug.cgi?id=699112
2013-08-20 21:52:04 +02:00
Jasper St. Pierre
d1a8177778 messageTray: Move the tray menu to a button
https://bugzilla.gnome.org/show_bug.cgi?id=699272
2013-08-19 09:35:09 -04:00
Jasper St. Pierre
1ec349f7c9 messageTray: Use the BoxPointer APIs for hiding without animating 2013-08-15 21:53:00 -04:00
Jasper St. Pierre
c4bc9616af messageTray: Remove code that happens on notification destruction 2013-08-15 21:52:59 -04:00
Jasper St. Pierre
de050991d4 messageTray: Remove the stackedNotification tracking complexity
We only have one signal left to track, but since it's destroy it
doesn't matter if it's disconnected or not since it will eventually
be GC'd.
2013-08-15 21:52:59 -04:00
Jasper St. Pierre
6521951e82 messageTray: Don't close the tray when responding to a notification stack
This is against the designed behavior.
2013-08-15 21:52:59 -04:00
Jasper St. Pierre
e818ddf152 messageTray: Clean up _updateState for the summary box pointer
This code still isn't great, but it's an improvement over what we
had before.
2013-08-15 21:52:59 -04:00
Jasper St. Pierre
b6499e5248 messageTray: Clean up _updateState for notifications
_updateState has a lot of variables that sort of gunk up the
code and make it more unreadable than need be. Clean up the logic
a lot by moving those variables into the places that they actually
matter, renaming them to remove prefixes, and remove some conditions
that are always met.
2013-08-15 21:52:59 -04:00
Jasper St. Pierre
3cb809b444 messageTray: Clean up the code that animates the notification
Right now the code chooses to animate based on whether or not the
notification was "removed", which is quite a sketchy subject. For
now, add an additional case so that we don't animate when we transition
to the lock screen.
2013-08-15 21:52:59 -04:00
Jasper St. Pierre
12b7e56261 messageTray: Remove an extraneous show
This means that the close button also does not have to be public.
2013-08-15 21:52:59 -04:00
Jasper St. Pierre
0007343175 messageTray: Remove dead code for updating the notification stack 2013-08-15 21:52:59 -04:00