* Full screen mode on windows @ 2008-05-31 11:16 Ivan Kanis 2008-05-31 12:53 ` joakim 0 siblings, 1 reply; 18+ messages in thread From: Ivan Kanis @ 2008-05-31 11:16 UTC (permalink / raw To: emacs-devel Hello, There is nice feature in Putty called full screen mode. It takes away all windows decoration including the taskbar. I would like to implement this feature natively on emacs. I have two ideas for the api: 1) Either I make a function called w32-toggle-fullscreen and do all the right thing in C, 2) Or I could expose the GetWindowLongPtr, SetWindowLongPtr and SetWindowPos as lisp function and write the toggle in lisp. Which approach is the most likely to get included? For info here is the Putty code that does the job : /* Remove the window furniture. */ style = GetWindowLongPtr(hwnd, GWL_STYLE); style &= ~(WS_CAPTION | WS_BORDER | WS_THICKFRAME); if (cfg.scrollbar_in_fullscreen) style |= WS_VSCROLL; else style &= ~WS_VSCROLL; SetWindowLongPtr(hwnd, GWL_STYLE, style); /* Resize ourselves to exactly cover the nearest monitor. */ get_fullscreen_rect(&ss); SetWindowPos(hwnd, HWND_TOP, ss.left, ss.top, ss.right - ss.left, ss.bottom - ss.top, SWP_FRAMECHANGED); Thanks for your feedbacks. -- Ivan http://kanis.fr Youth is a wonderful thing. What a crime to waste it on children. -- George Bernard Shaw ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 11:16 Full screen mode on windows Ivan Kanis @ 2008-05-31 12:53 ` joakim 2008-05-31 13:13 ` Eli Zaretskii ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: joakim @ 2008-05-31 12:53 UTC (permalink / raw To: Ivan Kanis; +Cc: emacs-devel I would suggest looking at the existing fullscreen option for X: (set-frame-parameter nil 'fullscreen 'fullboth) and make that work for w32, if it doesnt already! Ivan Kanis <expire-by-2008-06-06@kanis.fr> writes: > Hello, > > There is nice feature in Putty called full screen mode. It takes away > all windows decoration including the taskbar. > > I would like to implement this feature natively on emacs. I have two > ideas for the api: > > 1) Either I make a function called w32-toggle-fullscreen and do all > the right thing in C, > > 2) Or I could expose the GetWindowLongPtr, SetWindowLongPtr and > SetWindowPos as lisp function and write the toggle in lisp. > > Which approach is the most likely to get included? > > For info here is the Putty code that does the job : > > /* Remove the window furniture. */ > style = GetWindowLongPtr(hwnd, GWL_STYLE); > style &= ~(WS_CAPTION | WS_BORDER | WS_THICKFRAME); > if (cfg.scrollbar_in_fullscreen) > style |= WS_VSCROLL; > else > style &= ~WS_VSCROLL; > SetWindowLongPtr(hwnd, GWL_STYLE, style); > > /* Resize ourselves to exactly cover the nearest monitor. */ > get_fullscreen_rect(&ss); > SetWindowPos(hwnd, HWND_TOP, ss.left, ss.top, > ss.right - ss.left, > ss.bottom - ss.top, > SWP_FRAMECHANGED); > > Thanks for your feedbacks. -- Joakim Verona ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 12:53 ` joakim @ 2008-05-31 13:13 ` Eli Zaretskii 2008-05-31 13:25 ` Lennart Borgman (gmail) 2008-06-01 2:02 ` Jason Rumney 2008-05-31 18:25 ` Ivan Kanis 2008-06-04 17:57 ` Ivan Kanis 2 siblings, 2 replies; 18+ messages in thread From: Eli Zaretskii @ 2008-05-31 13:13 UTC (permalink / raw To: joakim; +Cc: emacs-devel, expire-by-2008-06-06 > From: joakim@verona.se > Date: Sat, 31 May 2008 14:53:58 +0200 > Cc: emacs-devel@gnu.org > > I would suggest looking at the existing fullscreen option for X: > > (set-frame-parameter nil 'fullscreen 'fullboth) > > and make that work for w32, if it doesnt already! It does work, although it only emulates the fullscreen mode. But (w32-send-sys-command #xf030) will do exactly what the OP wants. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 13:13 ` Eli Zaretskii @ 2008-05-31 13:25 ` Lennart Borgman (gmail) 2008-05-31 13:52 ` Lennart Borgman (gmail) 2008-06-01 2:02 ` Jason Rumney 1 sibling, 1 reply; 18+ messages in thread From: Lennart Borgman (gmail) @ 2008-05-31 13:25 UTC (permalink / raw To: Eli Zaretskii; +Cc: expire-by-2008-06-06, joakim, emacs-devel Eli Zaretskii wrote: >> From: joakim@verona.se >> Date: Sat, 31 May 2008 14:53:58 +0200 >> Cc: emacs-devel@gnu.org >> >> I would suggest looking at the existing fullscreen option for X: >> >> (set-frame-parameter nil 'fullscreen 'fullboth) >> >> and make that work for w32, if it doesnt already! > > It does work, although it only emulates the fullscreen mode. > > But > > (w32-send-sys-command #xf030) > > will do exactly what the OP wants. Maybe, but it does not do very much for me ... ;-) Are you sure you got the figures right? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 13:25 ` Lennart Borgman (gmail) @ 2008-05-31 13:52 ` Lennart Borgman (gmail) 2008-05-31 15:28 ` Eli Zaretskii 0 siblings, 1 reply; 18+ messages in thread From: Lennart Borgman (gmail) @ 2008-05-31 13:52 UTC (permalink / raw To: Eli Zaretskii; +Cc: emacs-devel, joakim, expire-by-2008-06-06 Lennart Borgman (gmail) wrote: > Eli Zaretskii wrote: >>> From: joakim@verona.se >>> Date: Sat, 31 May 2008 14:53:58 +0200 >>> Cc: emacs-devel@gnu.org >>> >>> I would suggest looking at the existing fullscreen option for X: >>> >>> (set-frame-parameter nil 'fullscreen 'fullboth) >>> >>> and make that work for w32, if it doesnt already! >> >> It does work, although it only emulates the fullscreen mode. >> >> But >> (w32-send-sys-command #xf030) >> >> will do exactly what the OP wants. > > Maybe, but it does not do very much for me ... ;-) > > Are you sure you got the figures right? Ah, sorry, it maximizes the screen. Nothing more magical ... ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 13:52 ` Lennart Borgman (gmail) @ 2008-05-31 15:28 ` Eli Zaretskii 2008-05-31 15:50 ` Lennart Borgman (gmail) 0 siblings, 1 reply; 18+ messages in thread From: Eli Zaretskii @ 2008-05-31 15:28 UTC (permalink / raw To: Lennart Borgman (gmail); +Cc: expire-by-2008-06-06, joakim, emacs-devel > Date: Sat, 31 May 2008 15:52:14 +0200 > From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> > Cc: emacs-devel@gnu.org, joakim@verona.se, expire-by-2008-06-06@kanis.fr > > Lennart Borgman (gmail) wrote: > > Eli Zaretskii wrote: > >>> From: joakim@verona.se > >>> Date: Sat, 31 May 2008 14:53:58 +0200 > >>> Cc: emacs-devel@gnu.org > >>> > >>> I would suggest looking at the existing fullscreen option for X: > >>> > >>> (set-frame-parameter nil 'fullscreen 'fullboth) > >>> > >>> and make that work for w32, if it doesnt already! > >> > >> It does work, although it only emulates the fullscreen mode. > >> > >> But > >> (w32-send-sys-command #xf030) > >> > >> will do exactly what the OP wants. > > > > Maybe, but it does not do very much for me ... ;-) > > > > Are you sure you got the figures right? > > Ah, sorry, it maximizes the screen. Nothing more magical ... But that's what the OP wanted, isn't it? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 15:28 ` Eli Zaretskii @ 2008-05-31 15:50 ` Lennart Borgman (gmail) 0 siblings, 0 replies; 18+ messages in thread From: Lennart Borgman (gmail) @ 2008-05-31 15:50 UTC (permalink / raw To: Eli Zaretskii; +Cc: expire-by-2008-06-06, joakim, emacs-devel Eli Zaretskii wrote: >> Date: Sat, 31 May 2008 15:52:14 +0200 >> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> >> Cc: emacs-devel@gnu.org, joakim@verona.se, expire-by-2008-06-06@kanis.fr >> >> Lennart Borgman (gmail) wrote: >>> Eli Zaretskii wrote: >>>>> From: joakim@verona.se >>>>> Date: Sat, 31 May 2008 14:53:58 +0200 >>>>> Cc: emacs-devel@gnu.org >>>>> >>>>> I would suggest looking at the existing fullscreen option for X: >>>>> >>>>> (set-frame-parameter nil 'fullscreen 'fullboth) >>>>> >>>>> and make that work for w32, if it doesnt already! >>>> It does work, although it only emulates the fullscreen mode. >>>> >>>> But >>>> (w32-send-sys-command #xf030) >>>> >>>> will do exactly what the OP wants. >>> Maybe, but it does not do very much for me ... ;-) >>> >>> Are you sure you got the figures right? >> Ah, sorry, it maximizes the screen. Nothing more magical ... > > But that's what the OP wanted, isn't it? Not sure. I thought he wanted to get rid of the title bar too. That has been usual for things like this before. But you are probably right. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 13:13 ` Eli Zaretskii 2008-05-31 13:25 ` Lennart Borgman (gmail) @ 2008-06-01 2:02 ` Jason Rumney 1 sibling, 0 replies; 18+ messages in thread From: Jason Rumney @ 2008-06-01 2:02 UTC (permalink / raw To: Eli Zaretskii; +Cc: expire-by-2008-06-06, joakim, emacs-devel Eli Zaretskii wrote: >> From: joakim@verona.se >> Date: Sat, 31 May 2008 14:53:58 +0200 >> Cc: emacs-devel@gnu.org >> >> I would suggest looking at the existing fullscreen option for X: >> >> (set-frame-parameter nil 'fullscreen 'fullboth) >> >> and make that work for w32, if it doesnt already! >> > > It does work, although it only emulates the fullscreen mode. > > But > > (w32-send-sys-command #xf030) > > will do exactly what the OP wants. > Neither the fullscreen parameter, nor the command above produce a full screen window. They both produce a maximised window that still contains the window decorations, and does not overlap the taskbar. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 12:53 ` joakim 2008-05-31 13:13 ` Eli Zaretskii @ 2008-05-31 18:25 ` Ivan Kanis 2008-05-31 21:11 ` Eli Zaretskii 2008-06-04 17:57 ` Ivan Kanis 2 siblings, 1 reply; 18+ messages in thread From: Ivan Kanis @ 2008-05-31 18:25 UTC (permalink / raw To: emacs-devel joakim@verona.se writes: > I would suggest looking at the existing fullscreen option for X: > > (set-frame-parameter nil 'fullscreen 'fullboth) I will try when I get back to work. "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes: > Eli Zaretskii wrote: >>> Lennart Borgman (gmail) wrote: >>>> Eli Zaretskii wrote: >>>>>> From: joakim@verona.se >>>>> But >>>>> (w32-send-sys-command #xf030) >>>>> >>>>> will do exactly what the OP wants. >>>> Maybe, but it does not do very much for me ... ;-) >>>> >>>> Are you sure you got the figures right? >>> Ah, sorry, it maximizes the screen. Nothing more magical ... >> >> But that's what the OP wanted, isn't it? > > Not sure. I thought he wanted to get rid of the title bar too. That > has been usual for things like this before. But you are probably > right. > I knew how to maximize with the w32-send-sys-command command. By full screen I mean no title bar, no windows decoration and no taskbar. -- Ivan http://kanis.fr Speak your mind, even if your voice shakes. Well aimed slingshots can topple giants. -- Maggie Kuhn ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 18:25 ` Ivan Kanis @ 2008-05-31 21:11 ` Eli Zaretskii 2008-05-31 21:16 ` Tom Tromey ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Eli Zaretskii @ 2008-05-31 21:11 UTC (permalink / raw To: Ivan Kanis; +Cc: emacs-devel > From: Ivan Kanis <expire-by-2008-06-06@kanis.fr> > Date: Sat, 31 May 2008 20:25:47 +0200 > > I knew how to maximize with the w32-send-sys-command command. By full > screen I mean no title bar, no windows decoration and no taskbar. Why would you want such a thing? If you don't want any GUI features at all, type Alt-RET into the Command Prompt window, and then invoke "emacs -nw". Is that what you want? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 21:11 ` Eli Zaretskii @ 2008-05-31 21:16 ` Tom Tromey 2008-06-01 1:30 ` Miles Bader 2008-06-01 10:05 ` Ivan Kanis 2 siblings, 0 replies; 18+ messages in thread From: Tom Tromey @ 2008-05-31 21:16 UTC (permalink / raw To: Eli Zaretskii; +Cc: emacs-devel, Ivan Kanis >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes: >> I knew how to maximize with the w32-send-sys-command command. By full >> screen I mean no title bar, no windows decoration and no taskbar. Eli> Why would you want such a thing? I'm playing around with using this (on Linux) to do presentations in Emacs. My current code is based on outline mode, but I'm thinking of switching to Muse. I reported a full-screen bug a while ago for Linux... really it would be nice to have both "real full screen" (for presentations) and "full screen but not hiding the panel" (for more ordinary Emacs-based apps, like a gud session). Tom ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 21:11 ` Eli Zaretskii 2008-05-31 21:16 ` Tom Tromey @ 2008-06-01 1:30 ` Miles Bader 2008-06-01 10:05 ` Ivan Kanis 2 siblings, 0 replies; 18+ messages in thread From: Miles Bader @ 2008-06-01 1:30 UTC (permalink / raw To: Eli Zaretskii; +Cc: emacs-devel, Ivan Kanis Eli Zaretskii <eliz@gnu.org> writes: >> I knew how to maximize with the w32-send-sys-command command. By full >> screen I mean no title bar, no windows decoration and no taskbar. > > Why would you want such a thing? If you don't want any GUI features > at all, type Alt-RET into the Command Prompt window, and then invoke > "emacs -nw". Emacs without title bar, window decorations, or taskbar, is still very different than emacs in a terminal... -Miles -- In New York, most people don't have cars, so if you want to kill a person, you have to take the subway to their house. And sometimes on the way, the train is delayed and you get impatient, so you have to kill someone on the subway. [George Carlin] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 21:11 ` Eli Zaretskii 2008-05-31 21:16 ` Tom Tromey 2008-06-01 1:30 ` Miles Bader @ 2008-06-01 10:05 ` Ivan Kanis 2008-06-03 6:53 ` Evans Winner 2 siblings, 1 reply; 18+ messages in thread From: Ivan Kanis @ 2008-06-01 10:05 UTC (permalink / raw To: emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> From: Ivan Kanis <expire-by-2008-06-06@kanis.fr> >> Date: Sat, 31 May 2008 20:25:47 +0200 >> >> I knew how to maximize with the w32-send-sys-command command. By full >> screen I mean no title bar, no windows decoration and no taskbar. > > Why would you want such a thing? If you don't want any GUI features > at all, type Alt-RET into the Command Prompt window, and then invoke > "emacs -nw". Is that what you want? Why? It looks good on Putty. It can be done on X, why not on Windows? It maximises screen estate and hides distractions so that I can focus on what needs to get done. AFAIK Emacs in the command prompt will not display picture and bdf fonts, I use both extensively. I don't think it has mouse support either which I use from time to time. -- Ivan http://kanis.fr Academic politics is the most vicious and bitter form of politics, because the stakes are so low. -- Wallace Sayre ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-06-01 10:05 ` Ivan Kanis @ 2008-06-03 6:53 ` Evans Winner 2008-06-03 7:01 ` dhruva 2008-06-03 7:23 ` Thien-Thi Nguyen 0 siblings, 2 replies; 18+ messages in thread From: Evans Winner @ 2008-06-03 6:53 UTC (permalink / raw To: emacs-devel Ivan Kanis <expire-by-2008-06-07@kanis.fr> writes: AFAIK Emacs in the command prompt will not display picture and bdf fonts, I use both extensively. I don't think it has mouse support either which I use from time to time. I have wanted a feature like this for a long time for W32. I started a brief gnu.emacs.help thread on the question in March [1]. At home I use stumpwm which puts all applications in a true fullscreen mode that maximizes available screen area while still allowing the use of GUI tools like the mouse and nice fonts, etc. But at work I am stuck with W32 and can't get that effect easily. Also, I suspect that a nice presentation package would be fairly easy to write for Emacs and could be quite useful, but it would be helpful for such a program to have access by way of Emacs lisp to a true fullscreen toggle on all platforms. The problem is that the W32 environment does not seem to provide a high-level or easily accessed function to do that. An attempt seems to have been made that requires python[2]. There is also some interest in programs like Dark Room or Writeroom which are text editors that are designed to be visually minimalistic for the purpose of reducing distractions. (There is a page on the EmacsWiki that describes some related hacks [3].) Emacs is evolved for use as a text editor for coding and some related things; features like a totally blank screen save text (no title bars or tool bars, etc.) seem to be of interest more to writers of fiction and poetry, and so forth. A related feature that would be nice for the ``Writeroom'' editing style, or for a presentation manager, is that of a disappearing mode-line, similar to the ``auto-hide'' function available for the ``task-bar'' used in the Windows GUI. I know one attempt has been made to implement this for Emacs[4], though it does not reclaim that space (or minibuffer space) for editing use, which would be nice. Footnotes: [1] I don't know how to cite Usenet messages. The Google archive says it is: Message-ID: <3112661d-c08e-412b-91f1-9e7ec192dc67@s37g2000prg.googlegroups.com> A direct link to the Google web archived thread is: http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/d97ba81a2428d37e/4e4024398a44deba?lnk=st&q=emacsw32+fullscreen#4e4024398a44deba [2] http://www.martyn.se/code/emacs/darkroom-mode/ [3] http://www.emacswiki.org/cgi-bin/wiki/WriteRoom [4] http://dse.livejournal.com/66834.html ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-06-03 6:53 ` Evans Winner @ 2008-06-03 7:01 ` dhruva 2008-06-03 20:56 ` Evans Winner 2008-06-03 7:23 ` Thien-Thi Nguyen 1 sibling, 1 reply; 18+ messages in thread From: dhruva @ 2008-06-03 7:01 UTC (permalink / raw To: Evans Winner; +Cc: emacs-devel Hi, I have the following key mapping and it just works fine on M$. You can add tests to check if tool bar is enabled and remove it, restore it later by storing keeping track (the way I restore - max/restore). (global-set-key [(control ?=)] '(lambda () (interactive) (if (and (boundp '*frame-max) *frame-max) (progn (setq *frame-max nil) (w32-send-sys-command 61728)) (progn (setq *frame-max t) (w32-send-sys-command 61488))))) -dhruva On Tue, Jun 3, 2008 at 12:23 PM, Evans Winner <thorne@timbral.net> wrote: > Ivan Kanis <expire-by-2008-06-07@kanis.fr> writes: > > AFAIK Emacs in the command prompt will not display > picture and bdf fonts, I use both extensively. I don't > think it has mouse support either which I use from time > to time. > > I have wanted a feature like this for a long time for W32. > I started a brief gnu.emacs.help thread on the question in > March [1]. At home I use stumpwm which puts all > applications in a true fullscreen mode that maximizes > available screen area while still allowing the use of GUI > tools like the mouse and nice fonts, etc. But at work I am > stuck with W32 and can't get that effect easily. > > Also, I suspect that a nice presentation package would be > fairly easy to write for Emacs and could be quite useful, > but it would be helpful for such a program to have access by > way of Emacs lisp to a true fullscreen toggle on all > platforms. The problem is that the W32 environment does not > seem to provide a high-level or easily accessed function to > do that. An attempt seems to have been made that requires > python[2]. > > There is also some interest in programs like Dark Room or > Writeroom which are text editors that are designed to be > visually minimalistic for the purpose of reducing > distractions. (There is a page on the EmacsWiki that > describes some related hacks [3].) Emacs is evolved for use > as a text editor for coding and some related things; > features like a totally blank screen save text (no title > bars or tool bars, etc.) seem to be of interest more to > writers of fiction and poetry, and so forth. A related > feature that would be nice for the ``Writeroom'' editing > style, or for a presentation manager, is that of a > disappearing mode-line, similar to the ``auto-hide'' > function available for the ``task-bar'' used in the Windows > GUI. I know one attempt has been made to implement this for > Emacs[4], though it does not reclaim that space (or > minibuffer space) for editing use, which would be nice. > > > Footnotes: > [1] I don't know how to cite Usenet messages. > The Google archive says it is: > Message-ID: <3112661d-c08e-412b-91f1-9e7ec192dc67@s37g2000prg.googlegroups.com> > A direct link to the Google web archived thread is: > http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/d97ba81a2428d37e/4e4024398a44deba?lnk=st&q=emacsw32+fullscreen#4e4024398a44deba > > [2] http://www.martyn.se/code/emacs/darkroom-mode/ > > [3] http://www.emacswiki.org/cgi-bin/wiki/WriteRoom > > [4] http://dse.livejournal.com/66834.html > > > > > -- Contents reflect my personal views only! ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-06-03 7:01 ` dhruva @ 2008-06-03 20:56 ` Evans Winner 0 siblings, 0 replies; 18+ messages in thread From: Evans Winner @ 2008-06-03 20:56 UTC (permalink / raw To: emacs-devel dhruva <dhruvakm@gmail.com> writes: Hi, I have the following key mapping and it just works fine on M$. You can add tests to check if tool bar is enabled and remove it, restore it later by storing keeping track (the way I restore - max/restore). (global-set-key [(control ?=)] '(lambda () (interactive) (if (and (boundp '*frame-max) *frame-max) (progn (setq *frame-max nil) (w32-send-sys-command 61728)) (progn (setq *frame-max t) (w32-send-sys-command 61488))))) This kind of thing has been suggested, but it does not solve the main problem (which is what the thread starter asked about) of removing all window borders (particularly the title bar) in the W32 environment. I spent a couple of hours at one point trying to find a code to use with the 'w32-send-sys-command function that would have that effect, but to no avail. It can be done, of course, by some means; Internet Explorer 7 (as an example) responds to the Windows standard F11 key the way that is being described (it even has a nice feature that allows you to temporarily get out of the fullscreen mode by bumping the top of the screen with the mouse pointer). ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-06-03 6:53 ` Evans Winner 2008-06-03 7:01 ` dhruva @ 2008-06-03 7:23 ` Thien-Thi Nguyen 1 sibling, 0 replies; 18+ messages in thread From: Thien-Thi Nguyen @ 2008-06-03 7:23 UTC (permalink / raw To: Evans Winner; +Cc: emacs-devel ⎛⎞ Evans Winner <thorne@timbral.net> ⎝⎠ Tue, 03 Jun 2008 00:53:25 -0600 Emacs is evolved for use as a text editor for coding and some related things; features like a totally blank screen save text (no title bars or tool bars, etc.) seem to be of interest more to writers of fiction and poetry, and so forth. when in the coding mode, i need no fighting light: keys unhampered stamp thoughts, so {w}ritely right. still, my kinding mind, years since hosing 'doze, holds the dopeful hope: may debtless oweing close. thi ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Full screen mode on windows 2008-05-31 12:53 ` joakim 2008-05-31 13:13 ` Eli Zaretskii 2008-05-31 18:25 ` Ivan Kanis @ 2008-06-04 17:57 ` Ivan Kanis 2 siblings, 0 replies; 18+ messages in thread From: Ivan Kanis @ 2008-06-04 17:57 UTC (permalink / raw To: emacs-devel joakim@verona.se writes: > I would suggest looking at the existing fullscreen option for X: > > (set-frame-parameter nil 'fullscreen 'fullboth) Hello, The following patch agains 22.2 makes it work. As a bonus I have added full width and full height so that it works properly. It's a rough start I need to work on startup options -fs -fh and -fw. diff -U5 -pr emacs-22.2/src/frame.c emacs-ivan/src/frame.c --- emacs-22.2/src/frame.c 2008-01-10 13:16:14.000000000 +0100 +++ emacs-ivan/src/frame.c 2008-06-04 19:47:38.000000000 +0200 @@ -2608,10 +2608,11 @@ x_fullscreen_adjust (f, width, height, t int newheight = FRAME_LINES (f); *top_pos = f->top_pos; *left_pos = f->left_pos; +#ifdef ivan if (f->want_fullscreen & FULLSCREEN_HEIGHT) { int ph; ph = FRAME_X_DISPLAY_INFO (f)->height; @@ -2629,10 +2630,11 @@ x_fullscreen_adjust (f, width, height, t newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw); pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, newwidth) - f->x_pixels_diff; newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw); *left_pos = 0; } +#endif *width = newwidth; *height = newheight; } diff -U5 -pr emacs-22.2/src/w32fns.c emacs-ivan/src/w32fns.c --- emacs-22.2/src/w32fns.c 2008-03-01 20:28:20.000000000 +0100 +++ emacs-ivan/src/w32fns.c 2008-06-04 19:47:37.000000000 +0200 @@ -3664,10 +3664,14 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); return 0; case WM_WINDOWPOSCHANGING: + /* Don't restrict fullscreen window */ + f = x_window_to_frame (dpyinfo, hwnd); + if (f && f->want_fullscreen & FULLSCREEN_BOTH) + goto dflt; /* Don't restrict the sizing of tip frames. */ if (hwnd == tip_window) return 0; { WINDOWPLACEMENT wp; diff -U5 -pr emacs-22.2/src/w32term.c emacs-ivan/src/w32term.c --- emacs-22.2/src/w32term.c 2008-02-23 14:49:09.000000000 +0100 +++ emacs-ivan/src/w32term.c 2008-06-04 19:47:37.000000000 +0200 @@ -255,10 +255,11 @@ static void w32_clip_to_row P_ ((struct static BOOL my_show_window P_ ((struct frame *, HWND, int)); static void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT)); static void my_set_focus P_ ((struct frame *, HWND)); static void my_set_foreground_window P_ ((HWND)); static void my_destroy_window P_ ((struct frame *, HWND)); +static void w32_fullscreen_hook P_ ((struct frame *)); static Lisp_Object Qvendor_specific_keysyms; \f /*********************************************************************** @@ -5559,10 +5560,71 @@ x_set_offset (f, xoff, yoff, change_grav 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); UNBLOCK_INPUT; } +static void +w32_fullscreen_hook(f) + FRAME_PTR f; +{ + DWORD style; + RECT workarea_rect, window_rect; + HWND hwnd; + + hwnd = FRAME_W32_WINDOW (f); + + switch (f->want_fullscreen) + { + case FULLSCREEN_BOTH: + /* Remove the window furniture. */ + my_show_window(f, hwnd, SW_MAXIMIZE); + style = GetWindowLongPtr(hwnd, GWL_STYLE); + style &= ~(WS_CAPTION | WS_BORDER | WS_THICKFRAME); + SetWindowLongPtr(hwnd, GWL_STYLE, style); + /* Resize ourselves to exactly cover the nearest monitor. */ + GetClientRect(GetDesktopWindow(), &workarea_rect); + SetWindowPos (hwnd, + HWND_TOP, + workarea_rect.left, + workarea_rect.top, + (workarea_rect.right - workarea_rect.left), + workarea_rect.bottom - workarea_rect.top, + SWP_FRAMECHANGED); + break; + case FULLSCREEN_WIDTH: + SystemParametersInfo( SPI_GETWORKAREA, 0, &workarea_rect, 0 ); + GetWindowRect(FRAME_W32_WINDOW(f), &window_rect); + SetWindowPos(hwnd, + NULL, + workarea_rect.left, + window_rect.top, + workarea_rect.right, + window_rect.bottom, 0); + break; + case FULLSCREEN_HEIGHT: + SystemParametersInfo( SPI_GETWORKAREA, 0, &workarea_rect, 0 ); + GetWindowRect(FRAME_W32_WINDOW(f), &window_rect); + SetWindowPos(hwnd, + NULL, + window_rect.left, + workarea_rect.top, + window_rect.right, + workarea_rect.bottom, 0); + break; + case FULLSCREEN_NONE: + /* Reinstate the window furniture. */ + hwnd = FRAME_W32_WINDOW (f); + style = GetWindowLongPtr(hwnd, GWL_STYLE); + style |= WS_CAPTION | WS_BORDER | WS_THICKFRAME; + SetWindowLongPtr(hwnd, GWL_STYLE, style); + my_show_window(f, hwnd, SW_RESTORE); + SetWindowPos(hwnd, NULL, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | + SWP_FRAMECHANGED); + break; + } +} /* Check if we need to resize the frame due to a fullscreen request. If so needed, resize the frame. */ static void x_check_fullscreen (f) @@ -6502,10 +6564,11 @@ w32_initialize () frame_raise_lower_hook = w32_frame_raise_lower; set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; condemn_scroll_bars_hook = w32_condemn_scroll_bars; redeem_scroll_bar_hook = w32_redeem_scroll_bar; judge_scroll_bars_hook = w32_judge_scroll_bars; + fullscreen_hook = w32_fullscreen_hook; scroll_region_ok = 1; /* we'll scroll partial frames */ char_ins_del_ok = 1; line_ins_del_ok = 1; /* we'll just blt 'em */ fast_clear_end_of_line = 1; /* X does this well */ ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2008-06-04 17:57 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-05-31 11:16 Full screen mode on windows Ivan Kanis 2008-05-31 12:53 ` joakim 2008-05-31 13:13 ` Eli Zaretskii 2008-05-31 13:25 ` Lennart Borgman (gmail) 2008-05-31 13:52 ` Lennart Borgman (gmail) 2008-05-31 15:28 ` Eli Zaretskii 2008-05-31 15:50 ` Lennart Borgman (gmail) 2008-06-01 2:02 ` Jason Rumney 2008-05-31 18:25 ` Ivan Kanis 2008-05-31 21:11 ` Eli Zaretskii 2008-05-31 21:16 ` Tom Tromey 2008-06-01 1:30 ` Miles Bader 2008-06-01 10:05 ` Ivan Kanis 2008-06-03 6:53 ` Evans Winner 2008-06-03 7:01 ` dhruva 2008-06-03 20:56 ` Evans Winner 2008-06-03 7:23 ` Thien-Thi Nguyen 2008-06-04 17:57 ` Ivan Kanis
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).