diff --git a/posframe.el b/posframe.el index 4ce7de9..e9bb98e 100644 --- a/posframe.el +++ b/posframe.el @@ -136,6 +136,8 @@ effect.") poshandler-extra-info width height + pixel-width + pixel-height max-width max-height min-width @@ -355,6 +357,8 @@ An example parent frame poshandler function is: You can use `posframe-delete-all' to delete all posframes." (let* ((position (or position (point))) + (pixel-width (if (and pixel-width width) t nil)) + (pixel-height (if (and pixel-width height) t nil)) (max-width (if (numberp max-width) (min max-width (frame-width)) (frame-width))) @@ -364,9 +368,11 @@ You can use `posframe-delete-all' to delete all posframes." (min-width (min (or min-width 1) max-width)) (min-height (min (or min-height 1) max-height)) (width (when width - (min (max width min-width) max-width))) + (if pixel-width width + (min (max width min-width) max-width)))) (height (when height - (min (max height min-height) max-height))) + (if pixel-height height + (min (max height min-height) max-height)))) (x-pixel-offset (or x-pixel-offset 0)) (y-pixel-offset (or y-pixel-offset 0)) ;;----------------------------------------------------- @@ -438,7 +444,9 @@ You can use `posframe-delete-all' to delete all posframes." :max-width max-width :max-height max-height :min-width min-width - :min-height min-height))) + :min-height min-height + :pixel-width pixel-width + :pixel-height pixel-height))) ;; Set posframe's size (posframe--set-frame-size size-info) ;; Re-adjust posframe's size when buffer's content has changed. @@ -781,9 +789,11 @@ will be removed." (max-width (plist-get size-info :max-width)) (max-height (plist-get size-info :max-height)) (min-width (plist-get size-info :min-width)) - (min-height (plist-get size-info :min-height))) - (when height (set-frame-height posframe height)) - (when width (set-frame-width posframe width)) + (min-height (plist-get size-info :min-height)) + (pixel-width (plist-get size-info :pixel-width)) + (pixel-height (plist-get size-info :pixel-height))) + (when height (set-frame-height posframe height nil pixel-height)) + (when width (set-frame-width posframe width nil pixel-width)) (unless (and height width) (posframe--fit-frame-to-buffer posframe max-height min-height max-width min-width