aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2003-02-08 11:18:32 +0000
committerJan Djärv2003-02-08 11:18:32 +0000
commit7b76ca1c43fcaa58bf2c7c3503c8f33399eab8eb (patch)
tree49d7e7cb08c701db988a1cda2304040439674921 /src
parentfea8973a15f90e36abfe4b6c40d520161b0ea1b8 (diff)
downloademacs-7b76ca1c43fcaa58bf2c7c3503c8f33399eab8eb.tar.gz
emacs-7b76ca1c43fcaa58bf2c7c3503c8f33399eab8eb.zip
xterm.c (x_make_frame_visible): Call gtk_window_deiconify.
xmenu.c (menu_position_func): Adjust menu popup position so that the menu is fully visible.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xmenu.c21
-rw-r--r--src/xterm.c1
3 files changed, 27 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b465355571e..94fe3226cf8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12003-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * xterm.c (x_make_frame_visible): Call gtk_window_deiconify.
4
5 * xmenu.c (menu_position_func): Adjust menu popup position so that
6 the menu is fully visible.
7
8
12003-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 92003-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 10
3 * xterm.c (x_text_icon, x_raise_frame, x_lower_frame) 11 * xterm.c (x_text_icon, x_raise_frame, x_lower_frame)
diff --git a/src/xmenu.c b/src/xmenu.c
index 2709a7641dd..6c289c45316 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2241,6 +2241,7 @@ static Lisp_Object *volatile menu_item_selection;
2241 create_and_show_popup_menu below. */ 2241 create_and_show_popup_menu below. */
2242struct next_popup_x_y 2242struct next_popup_x_y
2243{ 2243{
2244 FRAME_PTR f;
2244 int x; 2245 int x;
2245 int y; 2246 int y;
2246}; 2247};
@@ -2252,7 +2253,7 @@ struct next_popup_x_y
2252 PUSH_IN is not documented in the GTK manual. 2253 PUSH_IN is not documented in the GTK manual.
2253 USER_DATA is any data passed in when calling gtk_menu_popup. 2254 USER_DATA is any data passed in when calling gtk_menu_popup.
2254 Here it points to a struct next_popup_x_y where the coordinates 2255 Here it points to a struct next_popup_x_y where the coordinates
2255 to store in *X and *Y are. 2256 to store in *X and *Y are as well as the frame for the popup.
2256 2257
2257 Here only X and Y are used. */ 2258 Here only X and Y are used. */
2258static void 2259static void
@@ -2263,8 +2264,21 @@ menu_position_func (menu, x, y, push_in, user_data)
2263 gboolean *push_in; 2264 gboolean *push_in;
2264 gpointer user_data; 2265 gpointer user_data;
2265{ 2266{
2266 *x = ((struct next_popup_x_y*)user_data)->x; 2267 struct next_popup_x_y* data = (struct next_popup_x_y*)user_data;
2267 *y = ((struct next_popup_x_y*)user_data)->y; 2268 GtkRequisition req;
2269 int disp_width = FRAME_X_DISPLAY_INFO (data->f)->width;
2270 int disp_height = FRAME_X_DISPLAY_INFO (data->f)->height;
2271
2272 *x = data->x;
2273 *y = data->y;
2274
2275 /* Check if there is room for the menu. If not, adjust x/y so that
2276 the menu is fully visible. */
2277 gtk_widget_size_request (GTK_WIDGET (menu), &req);
2278 if (data->x + req.width > disp_width)
2279 *x -= data->x + req.width - disp_width;
2280 if (data->y + req.height > disp_height)
2281 *y -= data->y + req.height - disp_height;
2268} 2282}
2269 2283
2270static void 2284static void
@@ -2316,6 +2330,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
2316 2330
2317 popup_x_y.x = x; 2331 popup_x_y.x = x;
2318 popup_x_y.y = y; 2332 popup_x_y.y = y;
2333 popup_x_y.f = f;
2319 } 2334 }
2320 2335
2321 /* Display the menu. */ 2336 /* Display the menu. */
diff --git a/src/xterm.c b/src/xterm.c
index 2bda1e0982f..a27ddb22612 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -13696,6 +13696,7 @@ x_make_frame_visible (f)
13696#else /* not USE_X_TOOLKIT */ 13696#else /* not USE_X_TOOLKIT */
13697#ifdef USE_GTK 13697#ifdef USE_GTK
13698 gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f)); 13698 gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
13699 gtk_window_deiconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
13699#else 13700#else
13700 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); 13701 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
13701#endif /* not USE_GTK */ 13702#endif /* not USE_GTK */