Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly initialize the display for daemon mode. #2652

Conversation

travisbhartwell
Copy link
Contributor

WORK IN PROGRESS. NEEDS TESTING. NEEDS TO USE THIS THROUGHOUT THE REST
OF SPACEMACS INITIALIZATION.

Will push a clean commit when everything is working satisfactorily.

Add macro to wrap things that depend on the display being
initialized (and a frame active), such as getting the font. Advise the
server-create-window-system-frame function which is called by
emacsclient when creating a window-system frame. This is only run the
first time a frame is created, so the advice removes itself.

Fixes: #299 and #1894
(Among others)

@travisbhartwell travisbhartwell force-pushed the fix-daemon-mode-window-system-issues branch 3 times, most recently from e246f8f to fb52b00 Compare August 18, 2015 14:56
@syl20bnr
Copy link
Owner

For me it fixes the font issue, I could merge this if you are OK.

@syl20bnr syl20bnr added this to the release 0.105 milestone Aug 31, 2015
@travisbhartwell travisbhartwell force-pushed the fix-daemon-mode-window-system-issues branch from fb52b00 to 8e3a6eb Compare September 9, 2015 19:02
@travisbhartwell
Copy link
Contributor Author

Sure, I just changed the commit message to remove to the WIP.

@TheBB
Copy link
Collaborator

TheBB commented Sep 12, 2015

So, do we do it then?

@jmingtan
Copy link

This fix works well for me, thank you

@rihenperry
Copy link

@TheBB why is this pull request still not merged into develop? closing this pull request will close many contingent issues.

@travisbhartwell travisbhartwell force-pushed the fix-daemon-mode-window-system-issues branch from 8e3a6eb to 34ba3ea Compare October 15, 2015 15:47
@travisbhartwell travisbhartwell changed the title WIP: Properly initialize the display for daemon mode. Properly initialize the display for daemon mode. Oct 15, 2015
@travisbhartwell
Copy link
Contributor Author

I just rebased this onto develop as of today, so it should be even easier to apply. :)

@StreakyCobra
Copy link
Contributor

I just tested it and it works 😄 If you have troubles to make it work (like me 😅), be sure to remove all compiled version (*.elc) of involved files.

@cpaulik
Copy link
Contributor

cpaulik commented Nov 7, 2015

I just ran into the problem and this fixed it. 👍

@cpaulik
Copy link
Contributor

cpaulik commented Nov 7, 2015

I wrote too soon. This only solves the font issue for the first frame I create. On subsequent frames the font is again too big as reported in #535

Add macro to wrap things that depend on the display being
initialized (and a frame active), such as getting the font.  Advise the
`server-create-window-system-frame` function which is called by
emacsclient when creating a window-system frame.  This is only run the
first time a frame is created, so the advice removes itself.

Fixes: syl20bnr#299 and syl20bnr#1894
(Among others)
@travisbhartwell
Copy link
Contributor Author

@cpaulik I just tested it again (after rebasing on current develop) and can't reproduce. I did SPC : describe-font RET RET on each frame I created to test, and each one showed the same results.

What I did:

  1. Started Emacs in daemon mode with emacs --daemon
  2. Launched a graphical frame with emacsclient -c
  3. Opened another graphical frame with C-x 5 2.
  4. Closed both of those frames.
  5. Opened another graphical frame with emacsclient.
  6. While that was still opened, opened a second frame from the command line with emacsclient.
    I am using the default Spacemacs font choice. In each frame in these above scenarios, I got the following from describe-font:
name (opened by): -adobe-Source Code Pro-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1
       full name: Source Code Pro:pixelsize=13:foundry=adobe:weight=normal:slant=normal:width=normal:spacing=100:scalable=true
            size: 13
          height: 17
 baseline-offset:  0
relative-compose:  0

I am running on NixOS, with this patch rebased on the latest develop, in GNU Emacs 24.5.2.

I'd love to help track down why this isn't working for you to make this solution more robust so it can be merged. @cpaulik, could you tell me what steps you took to cause the issues with the incorrectly sized font? What platform are you on and which Emacs version? Are you using something other than the default font that is defined in the .spacemacs template? If so, I need to test against that and see why it's not working.

@travisbhartwell travisbhartwell force-pushed the fix-daemon-mode-window-system-issues branch from 34ba3ea to 33bb4a7 Compare November 7, 2015 19:26
@cpaulik
Copy link
Contributor

cpaulik commented Nov 8, 2015

I've started again with an empty dotspacemacs file and can not reproduce my issue. I'll try to track it down.

@cpaulik
Copy link
Contributor

cpaulik commented Nov 8, 2015

I've narrowed the problem down to the sublime-themes package in the themes-megapack layer . If I exclude sublime-themes everything works as expected. But I was not able to find anything suspicious in sublime-themes

@CestDiego
Copy link
Contributor

Is there any news regarding this one?

@syl20bnr
Copy link
Owner

syl20bnr commented Jan 4, 2016

I merged it!!! :-)
I had to make a fix which I hope won't break anything, see commit fa39bb1

Thank you 💯
Cherry-picked into develop branch, you can safely delete your branch.

@syl20bnr syl20bnr closed this Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants