Re: Notification when switching Spaces?
Re: Notification when switching Spaces?
- Subject: Re: Notification when switching Spaces?
- From: The Server Surfer <email@hidden>
- Date: Sun, 11 Nov 2007 02:13:05 -0600
On Nov 11, 2007, at 01.01, Eric Schlegel wrote:
I don't, actually, but I've worked with the engineers who do, and
I've worked on Spaces support in HIToolbox.framework.
Please extend my apologies to your colleagues as well. Again, I
wasn't accusing anyone of "slacking." It just seemed to me like a
trivial and obvious thing to add. Clearly, I hadn't given it nearly
as much thought as you guys have.
I didn't take offense, but I do think your comment was unwarranted,
since unless you work at Apple you're probably not aware of what
other factors might go into a decision about what capabilities to
provide.
True enough and fair enough. :)
As an end user, my main (read: only :p) concern is generally how/if
things work for me.
It would be trivial, but it's also not clear that it's something we
want to do. Notifications are API just as much as a function call or
method are; once we start posting a notification on Spaces switch,
and apps start depending on it, we have to continue to support that
notification forever. It's entirely possible that a future version
of Mac OS X will have some new UI for Spaces that will make it
difficult to continue to support a simple notification.
Ah, that makes sense. I'm generally not that far-sighted. :D
We also generally prefer to avoid providing avenues for apps to do
arbitrary things in response to UI effects such as Spaces or Expose,
because as soon as one app starts doing something on a Space switch,
lots of other apps will too, and the end result is that the Space
switch stops being an extremely smooth animation and starts getting
jerky and ugly.
I can certainly see why you would want to avoid that. What if the
notification were something along the lines of
NSSpacesSwitchDidOccur? That way, anything done by third parties
would occur after the switch, and not detract from its smoothness.
In general, we prefer to use data-driven approaches, where you tell
us in advance what you want to do when a space switch happens ("move
this window to the active space", for example), and we take care of
doing it for you. That allows us to keep the space switch animation
fast and fluid, and also allows us to change the space switch
behavior in future releases while still keeping compatibility with
what your app requested.
It's a good thing that you guys are in charge of this instead of me. :D
I do see what you're saying, and it's an aspect of Cocoa that I
appreciate greatly. That's actually part of the cause of my
frustration. If I had an Apple-approved notification to listen for,
my app would always Just Work⢠up until the point where Apple
implemented its functionality themselves, and I wouldn't have to
resort to hackery that could break with any/every x.x.x update.
It's true that this does prevent some developers from doing
interesting and useful things. The bottom line, though, is that when
providing an API, including a notification, we have to think in the
long term - is this something we can support for the next ten years?
That makes us very conservative about providing new API.
My only thought is, "Can I make this happen?" If it breaks down the
road, I figure I'll just have to fix it at that point.
Obviously, I've never written an API, and I'm not used to the idea of
having thousands of other developers relying on my code for the proper
functioning of theirs. ;)
What would your code do, if you had a notification of a Space switch?
Change the Desktop picture.
It was in response to this discussion thread: http://episteme.arstechnica.com/eve/forums/a/tpc/f/8300945231/m/950000158831
Basically, the OP wanted to have a different Desktop picture for each
Space, to aid in identification, and other posters agreed this would
be very useful. I don't personally have any need for something like
this since I only use two Spaces which are easily identified by their
contents, but being the helpful guy that I am, I pointed out that it
would only take a few minutes to write an app that listened for the
notification of a Spaces switch and set the Desktop accordingly, and
since it could take months or more for Apple to add this functionality
themselves, I volunteered to write said app. My initial frustration
from your response stemmed from the fact that I've spent more time
composing this email that I likely would've spent writing the app, had
the notification existed. My only thought was pleasing my friends,
certainly not, "Will this still work in 10 years?" I figured the app
would be useless by the time 10.6 came out anyway. I just didn't
think people should have to wait that long to get what seemed to be
(IMO) fairly trivial functionality.
I did try figuring out how/if I could use kCGWindowWorkspace to
accomplish my goal, but it seems to be some kind of Carbon thingy,
which I've never used at all (strictly Obj-C/Cocoa), and I was unable
to find any documentation for it in any case, so at this point, I'm
pretty much stuck.
Anyway, thank you for the education in the perils of API programming,
and all of the assistance provided by yourself and other posters. <3
Love,
The Server Surfer
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d- s+:+ a C++++ UB++ P L+++ E---- W+++ N o- K- w---
O- M++ V-- PS+++ PE- Y+ PGP t+ 5 X+ R+ tv++ b+ DI+ D
G+ e h---- r+++ y**
------END GEEK CODE BLOCK------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden