A stacking resource is a special kind of resource that can preempt the
current owner. Resources are assigned to clients in order of arrival,
this is, a new client attempting to grab will produce the former owner to
be released. However, when the current owner released ownership will be
passed back to the last owner.
This, clients are organised in a stack, where grabbing puts the client
at the top, and releasing removes from wherever the client is in the
stack. Because ownership can change even a client does not release, a
client should not use the resource based on the result of the grab()
method but instead use whatever indirect API the concrete resource
provides to assign ownership.
Clients of a stacking resource can be prioritised to prevent
preemption from a client with less priority. (For example, a modal dialog
should not loose focus because of a normal window appearing.)
|
|
__init__(self,
on_grab_callback=None,
on_release_callback=None,
*a,
**k)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
|
|
|
|
|
|
release_stacked(self)
Releases all objects that are stacked but do not own the resource. |
source code
|
|
|
|
release_if(self,
predicate)
Releases all objects that satisfy a predicate. |
source code
|
|
|
|
release_all(self)
Releases all stacked clients. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
|