* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
GdkWindow *sibling,
gboolean above)
{
- /* FIXME: Implement this */
+ GdkWindowImplQuartz *impl;
+ gint sibling_num;
+
+ impl = GDK_WINDOW_IMPL_QUARTZ (sibling->impl);
+ sibling_num = [impl->toplevel windowNumber];
+
+ impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+
+ if (above)
+ [impl->toplevel orderWindow:NSWindowAbove relativeTo:sibling_num];
+ else
+ [impl->toplevel orderWindow:NSWindowBelow relativeTo:sibling_num];
}
static void
toplevel = gdk_window_get_toplevel (window);
- *mask = _gdk_quartz_events_get_current_event_mask ();
+ *mask = _gdk_quartz_events_get_current_keyboard_modifiers () |
+ _gdk_quartz_events_get_current_mouse_modifiers ();
/* Get the y coordinate, needs to be flipped. */
if (window == _gdk_root)
static void
gdk_quartz_window_begin_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
+ GdkDevice *device,
gint button,
gint root_x,
gint root_y,
static void
gdk_quartz_window_begin_move_drag (GdkWindow *window,
+ GdkDevice *device,
gint button,
gint root_x,
gint root_y,
rect->height = ns_rect.size.height;
}
+/* Fake protocol to make gcc think that it's OK to call setStyleMask
+ even if it isn't. We check to make sure before actually calling
+ it. */
+
+@protocol CanSetStyleMask
+- (void)setStyleMask:(int)mask;
+@end
+
static void
gdk_quartz_window_set_decorations (GdkWindow *window,
- GdkWMDecoration decorations)
+ GdkWMDecoration decorations)
{
GdkWindowImplQuartz *impl;
NSUInteger old_mask, new_mask;
old_mask = [impl->toplevel styleMask];
- /* Note, there doesn't seem to be a way to change this without
- * recreating the toplevel. There might be bad side-effects of doing
- * that, but it seems alright.
- */
if (old_mask != new_mask)
{
NSRect rect;
rect = [NSWindow contentRectForFrameRect:rect styleMask:old_mask];
}
- impl->toplevel = [impl->toplevel initWithContentRect:rect
- styleMask:new_mask
- backing:NSBackingStoreBuffered
- defer:NO];
-
- [impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
- [impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
+ /* Note, before OS 10.6 there doesn't seem to be a way to change this without
+ * recreating the toplevel. There might be bad side-effects of doing
+ * that, but it seems alright.
+ */
+ if ([impl->toplevel respondsToSelector:@selector(setStyleMask:)])
+ {
+ [(id<CanSetStyleMask>)impl->toplevel setStyleMask:new_mask];
+ }
+ else
+ {
+ [impl->toplevel release];
+ impl->toplevel = [[GdkQuartzNSWindow alloc] initWithContentRect:rect
+ styleMask:new_mask
+ backing:NSBackingStoreBuffered
+ defer:NO];
+ [impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
+ [impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
+ [impl->toplevel setContentView:old_view];
+ }
- [impl->toplevel setContentView:old_view];
[impl->toplevel setFrame:rect display:YES];
/* Invalidate the window shadow for non-opaque views that have shadow