• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Moving other application windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving other application windows


  • Subject: Re: Moving other application windows
  • From: email@hidden
  • Date: Mon, 27 Jun 2005 12:09:22 +1000

I am trying to write a window manager which can manipulate applications not belonging to its own process. I am using _CGSDefaultConnection(), CGSGetWorkspaceWindowCount(), and CGSGetWorkspaceWindowList() to enumerate through the list of currently running windows. I then attempt to use CGSMoveWindow() to move windows when necessary. It works for windows within my application's process, but for all other windows I get a kCGErrorIllegalArgument.

Don't listen to all them other party-poopers. :)

There is at least one "master" program connected to the window server, which is by default the dock. It can do whatever it likes with anything - thus how the dock achieves Expose and similar effects. There is a function to set a secondary master, but last I checked it was actually unimplemented. :(

While you can thieve away "master" status, the dock steals it back quite quickly - introducing an unhealthy race condition you're very likely to lose out on.

The only reliable way to do things at present is to patch the dock via mach_inject or some other method, as someone else mentioned. The source to Desktop Manager (GPL) is a good start - specifically <http://svn.berlios.de/viewcvs/desktopmanager/DesktopManager/trunk/ DesktopManager/DockExtension/> which is all the gunk to patch the dock and so forth.

As a pre-emptive to /some/ people :P, let's not reiterate old religious arguments about the merit of doing this. Not on list, at least.

Wade Tregaskis (AIM/iChat, Yahoo & Skype: wadetregaskis, ICQ: 40056898, MSN: email@hidden, AV iChat & email: email@hidden, Jabber: email@hidden)
-- Sed quis custodiet ipsos custodes?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Moving other application windows
      • From: SA Dev <email@hidden>
References: 
 >Moving other application windows (From: David Schneider-Joseph <email@hidden>)

  • Prev by Date: Calling -retain inside -dealloc
  • Next by Date: Re: Calling -retain inside -dealloc
  • Previous by thread: Re: Moving other application windows
  • Next by thread: Re: Moving other application windows
  • Index(es):
    • Date
    • Thread