summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-05-09 22:34:00 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-05-09 22:34:00 +0000
commit912afb6e6bc029e4be99f2d145399c63a5a88a80 (patch)
tree1f4d50486395362693c66463990d7cc79a177b24
parent6d2c558bd8c4f3159f46ab2c58f1c51471785b9f (diff)
downloadmetacity-912afb6e6bc029e4be99f2d145399c63a5a88a80.tar.gz
DefaultScreen() returns the screen number not Screen*
2002-05-09 Havoc Pennington <hp@redhat.com> * src/frames.c (show_tip_now): DefaultScreen() returns the screen number not Screen* * src/frame.c (meta_frame_sync_to_window): immediately repaint frame whenever we resize it, if we're inside a grab operation. * src/frames.c (meta_frames_repaint_frame): new function * src/window.c (meta_window_new): initialize window's colormap (meta_window_notify_focus): install the colormap for a window when it gets focus, uninstall on unfocus. * src/window.h (struct _MetaWindow): store window's colormap * src/display.c (event_callback): note changes to window colormap * src/frame.c (EVENT_MASK): add ColormapChangeMask
-rw-r--r--ChangeLog20
-rw-r--r--src/display.c2
-rw-r--r--src/frame.c17
-rw-r--r--src/frames.c19
-rw-r--r--src/frames.h3
-rw-r--r--src/ui.c7
-rw-r--r--src/ui.h3
-rw-r--r--src/window.c13
-rw-r--r--src/window.h1
9 files changed, 80 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index afb99385..41665f95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
2002-05-09 Havoc Pennington <hp@redhat.com>
+ * src/frames.c (show_tip_now): DefaultScreen() returns the screen
+ number not Screen*
+
+ * src/frame.c (meta_frame_sync_to_window): immediately repaint
+ frame whenever we resize it, if we're inside a grab operation.
+
+ * src/frames.c (meta_frames_repaint_frame): new function
+
+ * src/window.c (meta_window_new): initialize window's colormap
+ (meta_window_notify_focus): install the colormap for a window when
+ it gets focus, uninstall on unfocus.
+
+ * src/window.h (struct _MetaWindow): store window's colormap
+
+ * src/display.c (event_callback): note changes to window colormap
+
+ * src/frame.c (EVENT_MASK): add ColormapChangeMask
+
+2002-05-09 Havoc Pennington <hp@redhat.com>
+
* src/display.c (event_callback): make Alt+button2 do a resize
2002-05-08 Anders Carlsson <andersca@gnu.org>
diff --git a/src/display.c b/src/display.c
index 479dde82..325586ff 100644
--- a/src/display.c
+++ b/src/display.c
@@ -1248,6 +1248,8 @@ event_callback (XEvent *event,
case SelectionNotify:
break;
case ColormapNotify:
+ if (window && !frame_was_receiver)
+ window->colormap = event->xcolormap.colormap;
break;
case ClientMessage:
if (window)
diff --git a/src/frame.c b/src/frame.c
index 54d786b8..62aa3f9a 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -29,7 +29,8 @@
ButtonPressMask | ButtonReleaseMask | \
PointerMotionMask | PointerMotionHintMask | \
EnterWindowMask | LeaveWindowMask | \
- FocusChangeMask)
+ FocusChangeMask | \
+ ColormapChangeMask)
void
meta_window_ensure_frame (MetaWindow *window)
@@ -303,8 +304,18 @@ meta_frame_sync_to_window (MetaFrame *frame,
frame->rect.height);
if (need_resize)
- meta_ui_reset_frame_bg (frame->window->screen->ui,
- frame->xwindow);
+ {
+ meta_ui_reset_frame_bg (frame->window->screen->ui,
+ frame->xwindow);
+
+ /* If we're interactively resizing the frame, repaint
+ * it immediately so we don't start to lag.
+ */
+ if (frame->window->display->grab_window ==
+ frame->window)
+ meta_ui_repaint_frame (frame->window->screen->ui,
+ frame->xwindow);
+ }
}
void
diff --git a/src/frames.c b/src/frames.c
index e5f57e2b..7ab33806 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -636,6 +636,8 @@ meta_frames_set_title (MetaFrames *frames,
frame = meta_frames_lookup_window (frames, xwindow);
+ g_assert (frame);
+
g_free (frame->title);
frame->title = g_strdup (title);
@@ -648,6 +650,21 @@ meta_frames_set_title (MetaFrames *frames,
gdk_window_invalidate_rect (frame->window, NULL, FALSE);
}
+void
+meta_frames_repaint_frame (MetaFrames *frames,
+ Window xwindow)
+{
+ GtkWidget *widget;
+ MetaUIFrame *frame;
+
+ widget = GTK_WIDGET (frames);
+
+ frame = meta_frames_lookup_window (frames, xwindow);
+
+ g_assert (frame);
+
+ gdk_window_process_updates (frame->window, TRUE);
+}
static void
show_tip_now (MetaFrames *frames)
@@ -731,7 +748,7 @@ show_tip_now (MetaFrames *frames)
#ifdef HAVE_GTK_MULTIHEAD
screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
#else
- screen_number = XScreenNumberOfScreen (DefaultScreen (gdk_display));
+ screen_number = DefaultScreen (gdk_display);
#endif
meta_fixed_tip_show (gdk_display,
screen_number,
diff --git a/src/frames.h b/src/frames.h
index a295b9e3..10e9380a 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -109,6 +109,9 @@ void meta_frames_set_title (MetaFrames *frames,
Window xwindow,
const char *title);
+void meta_frames_repaint_frame (MetaFrames *frames,
+ Window xwindow);
+
void meta_frames_get_geometry (MetaFrames *frames,
Window xwindow,
int *top_height, int *bottom_height,
diff --git a/src/ui.c b/src/ui.c
index 87eeef91..d59adb96 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -217,6 +217,13 @@ meta_ui_unflicker_frame_bg (MetaUI *ui,
}
void
+meta_ui_repaint_frame (MetaUI *ui,
+ Window xwindow)
+{
+ meta_frames_repaint_frame (ui->frames, xwindow);
+}
+
+void
meta_ui_reset_frame_bg (MetaUI *ui,
Window xwindow)
{
diff --git a/src/ui.h b/src/ui.h
index f0f38c5a..39b1817f 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -80,6 +80,9 @@ void meta_ui_set_frame_title (MetaUI *ui,
Window xwindow,
const char *title);
+void meta_ui_repaint_frame (MetaUI *ui,
+ Window xwindow);
+
MetaWindowMenu* meta_ui_window_menu_new (MetaUI *ui,
Window client_xwindow,
MetaMenuOp ops,
diff --git a/src/window.c b/src/window.c
index 7b5737c5..e28be25c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -316,7 +316,8 @@ meta_window_new (MetaDisplay *display, Window xwindow,
window->depth = attrs.depth;
window->xvisual = attrs.visual;
-
+ window->colormap = attrs.colormap;
+
window->title = NULL;
window->icon_name = NULL;
window->icon = NULL;
@@ -3393,6 +3394,11 @@ meta_window_notify_focus (MetaWindow *window,
g_list_prepend (window->display->mru_list, window);
if (window->frame)
meta_frame_queue_draw (window->frame);
+
+ meta_error_trap_push (window->display);
+ XInstallColormap (window->display->xdisplay,
+ window->colormap);
+ meta_error_trap_pop (window->display);
}
}
else if (event->type == FocusOut ||
@@ -3421,6 +3427,11 @@ meta_window_notify_focus (MetaWindow *window,
window->has_focus = FALSE;
if (window->frame)
meta_frame_queue_draw (window->frame);
+
+ meta_error_trap_push (window->display);
+ XUninstallColormap (window->display->xdisplay,
+ window->colormap);
+ meta_error_trap_pop (window->display);
}
}
diff --git a/src/window.h b/src/window.h
index d13d3f61..2c886c82 100644
--- a/src/window.h
+++ b/src/window.h
@@ -55,6 +55,7 @@ struct _MetaWindow
MetaFrame *frame;
int depth;
Visual *xvisual;
+ Colormap colormap;
char *desc; /* used in debug spew */
char *title;