Changeset 3926
- Timestamp:
- 2005年10月21日 00時44分28秒 (3 years ago)
- Files:
-
- trunk/lisp/ChangeLog.Meadow (modified) (1 diff)
- trunk/lisp/international/meadow.el (modified) (3 diffs)
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/mw32term.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/ChangeLog.Meadow
r3914 r3926 1 2005-10-21 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 3 * international/meadow.el (x-parse-geometry): Parse negative 4 offsets correctly. 5 1 6 2005-10-15 Kyotaro HORIGUCHI <horiguti@meadowy.org> 2 7 trunk/lisp/international/meadow.el
r3914 r3926 220 220 221 221 (defun x-parse-geometry (str) 222 (let* ((size-regexp "\\([ +\\-]?[0-9]+\\)[xX]\\([+\\-]?[0-9]+\\)")222 (let* ((size-regexp "\\([0-9]+\\)?\\(?:[xX]\\([0-9]+\\)\\)?") 223 223 (location-regexp "\\([+\\-][+\\-]?[0-9]+\\)") 224 224 (func (lambda (x) 225 (cond ((= (aref x 0) ?+) 226 (cons '+ (string-to-number 225 (cond ((null x) nil) 226 ((= (aref x 0) ?+) 227 (list '+ (string-to-number 227 228 (substring x 1)))) 228 229 ((= (aref x 0) ?-) 229 ( cons'- (string-to-number230 (list '- (string-to-number 230 231 (substring x 1)))) 231 232 (t nil)))) … … 236 237 (concat "^" size-regexp) 237 238 str) 238 (setq size-x (string-to-number (match-string 1 str)) 239 size-y (string-to-number (match-string 2 str)) 239 (setq size-x (and (match-string 1 str) 240 (string-to-number (match-string 1 str))) 241 size-y (and (match-string 2 str) 242 (string-to-number (match-string 2 str))) 240 243 str (substring str (match-end 0)))) 241 244 (if (string-match 242 (concat "^" location-regexp location-regexp)245 (concat "^" location-regexp "\\(" location-regexp "\\)?") 243 246 str) 244 247 (setq location-x (match-string 1 str) … … 246 249 location-x (funcall func location-x) 247 250 location-y (funcall func location-y))) 251 (if location-x 252 (setq result (cons (cons 'left location-x) result))) 253 (if location-y 254 (setq result (cons (cons 'top location-y) result))) 248 255 (if size-x 249 256 (setq result (cons (cons 'width size-x) result))) 250 257 (if size-y 251 258 (setq result (cons (cons 'height size-y) result))) 252 (cond ((eq (car location-x) '+)253 (setq result254 (cons (cons 'left (cdr location-x))255 result)))256 ((eq (car location-x) '-)257 (setq result258 (cons (cons 'right (cdr location-x))259 result))))260 (cond ((eq (car location-y) '+)261 (setq result262 (cons (cons 'top (cdr location-y))263 result)))264 ((eq (car location-y) '-)265 (setq result266 (cons (cons 'bottom (cdr location-y))267 result))))268 259 result)) 269 260 trunk/src/ChangeLog.Meadow
r3925 r3926 1 2005-10-21 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 3 * mw32term.c (mw32_calc_absolute_position): Implement this 4 function. 5 (x_set_offset): Set negative offsets correctly. 6 1 7 2005-10-19 Kyotaro HORIGUCHI <horiguti@meadowy.org> 2 8 trunk/src/mw32term.c
r3925 r3926 5351 5351 mw32_calc_absolute_position (struct frame *f) 5352 5352 { 5353 #if 0 5354 Window child; 5355 int win_x = 0, win_y = 0; 5356 int flags = f->output_data.x->size_hint_flags; 5357 int this_window; 5358 5353 int flags = f->size_hint_flags; 5354 int working_area_width; 5355 int working_area_height; 5356 RECT working_area_rect; 5357 int width, height; 5358 RECT win_rect = {0, 0, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f)}; 5359 5359 5360 /* We have nothing to do if the current position 5360 5361 is already for the top-left corner. */ … … 5362 5363 return; 5363 5364 5364 #ifdef USE_X_TOOLKIT 5365 this_window = XtWindow (f->output_data.x->widget); 5366 #else 5367 this_window = FRAME_X_WINDOW (f); 5368 #endif 5369 5370 /* Find the position of the outside upper-left corner of 5371 the inner window, with respect to the outer window. 5372 But do this only if we will need the results. */ 5373 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) 5374 { 5375 int count; 5376 5377 BLOCK_INPUT; 5378 count = x_catch_errors (FRAME_X_DISPLAY (f)); 5379 while (1) 5380 { 5381 x_clear_errors (FRAME_X_DISPLAY (f)); 5382 XTranslateCoordinates (FRAME_X_DISPLAY (f), 5383 5384 /* From-window, to-window. */ 5385 this_window, 5386 f->output_data.x->parent_desc, 5387 5388 /* From-position, to-position. */ 5389 0, 0, &win_x, &win_y, 5390 5391 /* Child of win. */ 5392 &child); 5393 if (x_had_errors_p (FRAME_X_DISPLAY (f))) 5394 { 5395 Window newroot, newparent = 0xdeadbeef; 5396 Window *newchildren; 5397 unsigned int nchildren; 5398 5399 if (! XQueryTree (FRAME_X_DISPLAY (f), this_window, &newroot, 5400 &newparent, &newchildren, &nchildren)) 5401 break; 5402 5403 XFree ((char *) newchildren); 5404 5405 f->output_data.x->parent_desc = newparent; 5406 } 5407 else 5408 break; 5409 } 5410 5411 x_uncatch_errors (FRAME_X_DISPLAY (f), count); 5412 UNBLOCK_INPUT; 5413 } 5414 5415 /* Treat negative positions as relative to the leftmost bottommost 5416 position that fits on the screen. */ 5365 /* Get size of working area in primary screen. */ 5366 SystemParametersInfo (SPI_GETWORKAREA, 0, &working_area_rect, 0); 5367 5368 working_area_width = working_area_rect.right - working_area_rect.left; 5369 working_area_height = working_area_rect.bottom - working_area_rect.top; 5370 5371 /* Get size of frame including non-client region. */ 5372 AdjustWindowRectEx (&win_rect, f->output_data.mw32->dwStyle, 5373 FRAME_EXTERNAL_MENU_BAR (f), 5374 f->output_data.mw32->dwStyleEx); 5375 5376 width = win_rect.right - win_rect.left; 5377 height = win_rect.bottom - win_rect.top; 5378 5379 /* Calculate absolute position. */ 5417 5380 if (flags & XNegative) 5418 f->output_data.x->left_pos = (FRAME_X_DISPLAY_INFO (f)->width 5419 - 2 * f->output_data.x->border_width - win_x 5420 - FRAME_PIXEL_WIDTH (f) 5421 + f->output_data.x->left_pos); 5422 5423 { 5424 int height = FRAME_PIXEL_HEIGHT (f); 5425 5426 #if defined USE_X_TOOLKIT && defined USE_MOTIF 5427 /* Something is fishy here. When using Motif, starting Emacs with 5428 `-g -0-0', the frame appears too low by a few pixels. 5429 5430 This seems to be so because initially, while Emacs is starting, 5431 the column widget's height and the frame's pixel height are 5432 different. The column widget's height is the right one. In 5433 later invocations, when Emacs is up, the frame's pixel height 5434 is right, though. 5435 5436 It's not obvious where the initial small difference comes from. 5437 2000-12-01, gerd. */ 5438 5439 XtVaGetValues (f->output_data.x->column_widget, XtNheight, &height, NULL); 5440 #endif 5381 f->left_pos = working_area_width - width + f->left_pos; 5441 5382 5442 5383 if (flags & YNegative) 5443 f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height 5444 - 2 * f->output_data.x->border_width 5445 - win_y 5446 - height 5447 + f->top_pos); 5448 } 5449 5450 /* The left_pos and top_pos 5451 are now relative to the top and left screen edges, 5452 so the flags should correspond. */ 5453 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); 5454 #endif 5384 f->top_pos = working_area_height - height + f->top_pos; 5385 5386 f->size_hint_flags &= ~ (XNegative | YNegative); 5455 5387 } 5456 5388 … … 5466 5398 int change_gravity) 5467 5399 { 5468 if (change_gravity )5400 if (change_gravity > 0) 5469 5401 { 5470 5402 f->top_pos = yoff; 5471 5403 f->left_pos = xoff; 5472 #if 0 5473 f->output_data.mw32->size_hint_flags &= ~ (XNegative | YNegative); 5404 f->size_hint_flags &= ~ (XNegative | YNegative); 5405 5474 5406 if (xoff < 0) 5475 f-> output_data.mw32->size_hint_flags |= XNegative;5407 f->size_hint_flags |= XNegative; 5476 5408 if (yoff < 0) 5477 f->output_data.mw32->size_hint_flags |= YNegative; 5478 f->output_data.mw32->win_gravity = NorthWestGravity; 5479 #endif 5409 f->size_hint_flags |= YNegative; 5410 f->win_gravity = NorthWestGravity; 5480 5411 } 5481 5412 mw32_calc_absolute_position (f);
