From 47c53789fd79f06a5e04dfe12b782a7321c3e00b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 2 Dec 2005 14:55:14 +0000 Subject: [PATCH] * xfns.c (x_real_positions): int ign => unsigned int. (xg_set_icon_from_xpm_data): Remove unused variable err. (x_set_name_internal, Fx_create_frame, xg_set_icon): Add cast to remove compiler warning. (compute_tip_xy): Put tip above pointer if it doesn't fit below. --- src/xfns.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index c3eb173b4f9..e471b13f403 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -608,7 +608,7 @@ x_real_positions (f, xptr, yptr) if (! had_errors) { - int ign; + unsigned int ign; Window child, rootw; /* Get the real coordinates for the WM window upper left corner */ @@ -794,9 +794,7 @@ xg_set_icon (f, file) { GdkPixbuf *pixbuf; GError *err = NULL; - char *filename; - - filename = SDATA (found); + char *filename = (char *) SDATA (found); BLOCK_INPUT; pixbuf = gdk_pixbuf_new_from_file (filename, &err); @@ -825,17 +823,12 @@ xg_set_icon_from_xpm_data (f, data) char **data; { int result = 0; - GError *err = NULL; - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data); + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) data); if (!pixbuf) - { - g_error_free (err); - return 0; - } + return 0; - gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - pixbuf); + gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), pixbuf); g_object_unref (pixbuf); return 1; } @@ -1649,7 +1642,7 @@ x_set_name_internal (f, name) #ifdef USE_GTK gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - SDATA (ENCODE_UTF_8 (name))); + (char *) SDATA (ENCODE_UTF_8 (name))); #else /* not USE_GTK */ XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); #endif /* not USE_GTK */ @@ -3376,7 +3369,7 @@ This function is an internal primitive--use `make-frame' instead. */) FRAME_OUTER_WINDOW (f), dpyinfo->Xatom_wm_client_leader, XA_WINDOW, 32, PropModeReplace, - (char *) &dpyinfo->client_leader_window, 1); + (unsigned char *) &dpyinfo->client_leader_window, 1); UNBLOCK_INPUT; } @@ -4942,6 +4935,9 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) *root_y = XINT (top); else if (*root_y + XINT (dy) - height < 0) *root_y -= XINT (dy); + else if (*root_y + XINT (dy) >= FRAME_X_DISPLAY_INFO (f)->height) + /* Put tip above the pointer. */ + *root_y -= XINT (dy); else { *root_y -= height; -- 2.39.5