summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-08-20 20:18:18 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-08-20 20:18:18 +0000
commite74969bd170b38f4a45fcb8b934b5b1060780d5c (patch)
treec6ee3a11a281481baa03622b1fa38581cda74d9c /src
parentb5a99f049c56cde36a10d3bef200cc2a998ca379 (diff)
downloadmetacity-e74969bd170b38f4a45fcb8b934b5b1060780d5c.tar.gz
metacity-e74969bd170b38f4a45fcb8b934b5b1060780d5c.tar.bz2
if in the title rect check for y <= TOP_RESIZE_HEIGHT
2002-08-20 Havoc Pennington <hp@redhat.com> * src/frames.c (get_control): if in the title rect check for y <= TOP_RESIZE_HEIGHT * src/display.c (meta_spew_event): put x/y coordinates in spew for enter/leave notify * src/frames.c (meta_frames_motion_notify_event): move cursor changing from here to update_prelit_control so it happens on enter notify as well (get_control): change test "y < TOP_RESIZE_HEIGHT" to "y <= TOP_RESIZE_HEIGHT" * src/Makefile.am (EXTRA_DIST): include .in files in EXTRA_DIST
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/display.c12
-rw-r--r--src/frames.c122
3 files changed, 72 insertions, 64 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d0d234b..4355317 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -128,7 +128,7 @@ CLEANFILES = inlinepixbufs.h
inlinepixbufs.h: $(IMAGES)
$(GDK_PIXBUF_CSOURCE) --raw --build-list $(VARIABLES) >$(srcdir)/inlinepixbufs.h
-EXTRA_DIST=$(desktopfiles_DATA) $(IMAGES) $(schema_DATA) update-from-egg.sh
+EXTRA_DIST=$(desktopfiles_DATA) $(IMAGES) $(schema_DATA) update-from-egg.sh $(desktopfiles_in_files) $(schema_in_files)
EGGDIR=$(srcdir)/../../libegg/libegg
diff --git a/src/display.c b/src/display.c
index ac1f787..7715aeb 100644
--- a/src/display.c
+++ b/src/display.c
@@ -1866,23 +1866,27 @@ meta_spew_event (MetaDisplay *display,
break;
case EnterNotify:
name = "EnterNotify";
- extra = g_strdup_printf ("win: 0x%lx root: 0x%lx subwindow: 0x%lx mode: %s detail: %s focus: %d",
+ extra = g_strdup_printf ("win: 0x%lx root: 0x%lx subwindow: 0x%lx mode: %s detail: %s focus: %d x: %d y: %d",
event->xcrossing.window,
event->xcrossing.root,
event->xcrossing.subwindow,
meta_event_mode_to_string (event->xcrossing.mode),
meta_event_detail_to_string (event->xcrossing.detail),
- event->xcrossing.focus);
+ event->xcrossing.focus,
+ event->xcrossing.x,
+ event->xcrossing.y);
break;
case LeaveNotify:
name = "LeaveNotify";
- extra = g_strdup_printf ("win: 0x%lx root: 0x%lx subwindow: 0x%lx mode: %s detail: %s focus: %d",
+ extra = g_strdup_printf ("win: 0x%lx root: 0x%lx subwindow: 0x%lx mode: %s detail: %s focus: %d x: %d y: %d",
event->xcrossing.window,
event->xcrossing.root,
event->xcrossing.subwindow,
meta_event_mode_to_string (event->xcrossing.mode),
meta_event_detail_to_string (event->xcrossing.detail),
- event->xcrossing.focus);
+ event->xcrossing.focus,
+ event->xcrossing.x,
+ event->xcrossing.y);
break;
case FocusIn:
name = "FocusIn";
diff --git a/src/frames.c b/src/frames.c
index f3f43d7..03d7b7f 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -1329,7 +1329,62 @@ meta_frames_update_prelit_control (MetaFrames *frames,
MetaFrameControl control)
{
MetaFrameControl old_control;
+ MetaCursor cursor;
+ meta_verbose ("Updating prelit control from %d to %d\n",
+ frame->prelit_control, control);
+
+ cursor = META_CURSOR_DEFAULT;
+
+ switch (control)
+ {
+ case META_FRAME_CONTROL_CLIENT_AREA:
+ break;
+ case META_FRAME_CONTROL_NONE:
+ break;
+ case META_FRAME_CONTROL_TITLE:
+ break;
+ case META_FRAME_CONTROL_DELETE:
+ break;
+ case META_FRAME_CONTROL_MENU:
+ break;
+ case META_FRAME_CONTROL_MINIMIZE:
+ break;
+ case META_FRAME_CONTROL_MAXIMIZE:
+ break;
+ case META_FRAME_CONTROL_UNMAXIMIZE:
+ break;
+ case META_FRAME_CONTROL_RESIZE_SE:
+ cursor = META_CURSOR_SE_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_S:
+ cursor = META_CURSOR_SOUTH_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_SW:
+ cursor = META_CURSOR_SW_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_N:
+ cursor = META_CURSOR_NORTH_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_NE:
+ cursor = META_CURSOR_NE_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_NW:
+ cursor = META_CURSOR_NW_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_W:
+ cursor = META_CURSOR_WEST_RESIZE;
+ break;
+ case META_FRAME_CONTROL_RESIZE_E:
+ cursor = META_CURSOR_EAST_RESIZE;
+ break;
+ }
+
+ /* set/unset the prelight cursor */
+ meta_core_set_screen_cursor (gdk_display,
+ frame->xwindow,
+ cursor);
+
/* Only prelight buttons */
if (control != META_FRAME_CONTROL_MENU &&
control != META_FRAME_CONTROL_MINIMIZE &&
@@ -1379,65 +1434,13 @@ meta_frames_motion_notify_event (GtkWidget *widget,
{
MetaFrameControl control;
int x, y;
- MetaCursor cursor;
gdk_window_get_pointer (frame->window, &x, &y, NULL);
control = get_control (frames, frame, x, y);
- /* Update prelit control */
+ /* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control);
-
- cursor = META_CURSOR_DEFAULT;
-
- switch (control)
- {
- case META_FRAME_CONTROL_CLIENT_AREA:
- break;
- case META_FRAME_CONTROL_NONE:
- break;
- case META_FRAME_CONTROL_TITLE:
- break;
- case META_FRAME_CONTROL_DELETE:
- break;
- case META_FRAME_CONTROL_MENU:
- break;
- case META_FRAME_CONTROL_MINIMIZE:
- break;
- case META_FRAME_CONTROL_MAXIMIZE:
- break;
- case META_FRAME_CONTROL_UNMAXIMIZE:
- break;
- case META_FRAME_CONTROL_RESIZE_SE:
- cursor = META_CURSOR_SE_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_S:
- cursor = META_CURSOR_SOUTH_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_SW:
- cursor = META_CURSOR_SW_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_N:
- cursor = META_CURSOR_NORTH_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_NE:
- cursor = META_CURSOR_NE_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_NW:
- cursor = META_CURSOR_NW_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_W:
- cursor = META_CURSOR_WEST_RESIZE;
- break;
- case META_FRAME_CONTROL_RESIZE_E:
- cursor = META_CURSOR_EAST_RESIZE;
- break;
- }
-
- /* set/unset the prelight cursor */
- meta_core_set_screen_cursor (gdk_display,
- frame->xwindow,
- cursor);
queue_tip (frames);
}
@@ -1714,10 +1717,6 @@ meta_frames_leave_notify_event (GtkWidget *widget,
clear_tip (frames);
- meta_core_set_screen_cursor (gdk_display,
- frame->xwindow,
- META_CURSOR_DEFAULT);
-
return TRUE;
}
@@ -1803,7 +1802,12 @@ get_control (MetaFrames *frames,
return META_FRAME_CONTROL_MENU;
if (POINT_IN_RECT (x, y, fgeom.title_rect))
- return META_FRAME_CONTROL_TITLE;
+ {
+ if (y <= TOP_RESIZE_HEIGHT)
+ return META_FRAME_CONTROL_RESIZE_N;
+ else
+ return META_FRAME_CONTROL_TITLE;
+ }
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
@@ -1873,7 +1877,7 @@ get_control (MetaFrames *frames,
if (has_vert)
return META_FRAME_CONTROL_RESIZE_S;
}
- else if (y < TOP_RESIZE_HEIGHT)
+ else if (y <= TOP_RESIZE_HEIGHT)
{
if (has_vert)
return META_FRAME_CONTROL_RESIZE_N;