Opening a frame on a second monitor

View: New views
8 Messages — Rating Filter:   Alert me  

Opening a frame on a second monitor

by Bruce Knoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been searching for a command that allows me to open a frame on a
second monitor on WinXP. I recall that I even succeeded once, but don't
know what I did (or if I was dreaming).

I want a "make-frame-on-display" command that works on Win32 (the
existing "make-frame-on-display" command seems to only support X).

Suggestions?

Thanks,

Bruce




Re: Opening a frame on a second monitor

by Jason Rumney-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

BKnoth wrote:
> I've been searching for a command that allows me to open a frame on a
> second monitor on WinXP. I recall that I even succeeded once, but
> don't know what I did (or if I was dreaming).
>
> I want a "make-frame-on-display" command that works on Win32 (the
> existing "make-frame-on-display" command seems to only support X).

That's not what make-frame-on-display does.  It opens a frame on a
different X display (ie, a different login session).  Multiple monitors
in the same session are handled by setting the x and y offset in
frame-parameters to position the frame where you want it, whether on X
or on Windows.




Re: Opening a frame on a second monitor

by Bruce Knoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/4/2009 7:42 PM, Jason Rumney wrote:

> BKnoth wrote:
>> I've been searching for a command that allows me to open a frame on a
>> second monitor on WinXP. I recall that I even succeeded once, but
>> don't know what I did (or if I was dreaming).
>>
>> I want a "make-frame-on-display" command that works on Win32 (the
>> existing "make-frame-on-display" command seems to only support X).
>
> That's not what make-frame-on-display does. It opens a frame on a
> different X display (ie, a different login session). Multiple monitors
> in the same session are handled by setting the x and y offset in
> frame-parameters to position the frame where you want it, whether on X
> or on Windows.
>
>
>
>

Thanks - you answered my question. The following frame alist opens a
frame on my second monitor when used with the make-frame function.

(setq second-frame-alist
               '((top . 0)
                 (left . -1280)
                 (width . 150)
                 (height . 56)
                 (cursor-color . "deep sky blue")
                 (background-color . "Wheat")
                 (foreground-color . "blue3")
                )
              )

I appreciate your help, Jason.

- Bruce




Re: Opening a frame on a second monitor

by Bruce Knoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/4/2009 7:42 PM, Jason Rumney wrote:

> BKnoth wrote:
>> I've been searching for a command that allows me to open a frame on a
>> second monitor on WinXP. I recall that I even succeeded once, but
>> don't know what I did (or if I was dreaming).
>>
>> I want a "make-frame-on-display" command that works on Win32 (the
>> existing "make-frame-on-display" command seems to only support X).
>
> That's not what make-frame-on-display does. It opens a frame on a
> different X display (ie, a different login session). Multiple monitors
> in the same session are handled by setting the x and y offset in
> frame-parameters to position the frame where you want it, whether on X
> or on Windows.
>
>
>
>

Thanks - you answered my question. The following frame alist opens a
frame on my second monitor when used with the make-frame function.

(setq second-frame-alist
               '((top . 0)
                 (left . -1280)
                 (width . 150)
                 (height . 56)
                 (cursor-color . "deep sky blue")
                 (background-color . "Wheat")
                 (foreground-color . "blue3")
                )
              )

I appreciate your help, Jason.

- Bruce




RE: Re: Opening a frame on a second monitor

by Drew Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Thanks - you answered my question. The following frame alist opens a
> frame on my second monitor when used with the make-frame function.
>
> (setq second-frame-alist
>                '((top . 0)
>                  (left . -1280)
>                  (width . 150)
                   ...

FYI - You can use (x-display-pixel-width) to pick up the `1280' value
automatically, so it is correct regardless of the current display. In the case
of yours, it will be 1280.

So you could, if you wanted, use:
(setq second-frame-alist
      `((top . 0)
        (left . ,(x-display-pixel-width))
        (width . 150)
        ...




Re: Opening a frame on a second monitor

by Bruce Knoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/5/2009 10:33 AM, Drew Adams wrote:

>> Thanks - you answered my question. The following frame alist opens a
>> frame on my second monitor when used with the make-frame function.
>>
>> (setq second-frame-alist
>>                 '((top . 0)
>>                   (left . -1280)
>>                   (width . 150)
>                     ...
>
> FYI - You can use (x-display-pixel-width) to pick up the `1280' value
> automatically, so it is correct regardless of the current display. In the case
> of yours, it will be 1280.
>
> So you could, if you wanted, use:
> (setq second-frame-alist
>        `((top . 0)
>          (left . ,(x-display-pixel-width))
>          (width . 150)
>          ...
>
>
>
>
Did you mean to have the "," in front of "(x-display-pixel-width)"?
Also, the "(x-display-pixel-width)" function is in frame.el but I can't
call it without making it interactive. What's the proper way to call a
function that doesn't show up as an emacs command?

Thanks for your help,

Bruce





RE: Re: Opening a frame on a second monitor

by Drew Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> > FYI - You can use (x-display-pixel-width) to pick up the
> `1280' value
> > automatically, so it is correct regardless of the current
> display. In the case
> > of yours, it will be 1280.
> >
> > So you could, if you wanted, use:
> > (setq second-frame-alist
> >        `((top . 0)
> >          (left . ,(x-display-pixel-width))
> >          (width . 150)
> >          ...
> >
> Did you mean to have the "," in front of "(x-display-pixel-width)"?

Yes. See the Elisp manual, node Backquote.

> Also, the "(x-display-pixel-width)" function is in frame.el
> but I can't call it without making it interactive.
> What's the proper way to call a
> function that doesn't show up as an emacs command?

You can use `M-:'.

M-: (x-display-pixel-width)




Re: Re: Opening a frame on a second monitor

by Jason Rumney-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Drew Adams wrote:
> FYI - You can use (x-display-pixel-width) to pick up the `1280' value
> automatically, so it is correct regardless of the current display. In the case
> of yours, it will be 1280.
>  
Not really, as one monitor will be to the left of the other, and the
other will to be to the right of the first.  You can't generalize - some
people will configure their main monitor to the left, others to the
right, and still others will configure them above, below or even
diagonally.  The values for left and top need to be customized for the
particular setup that the user has.