News for hackers. Stuff that matters.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by zbuf on Thursday March 23, 2017 @05:27PM (#13944492)
Best bit is that X11 runs really well these days -- responsive, fast, reliable. Emacs runs great, gitk, xterm, xosview, mplayer window manager, even Firefox is alright. Renoise, Maya, Blender too. Not to mention network transparency when I need it. It's a great environment to get my work done, and 3x hi res displays is the stuff I dreamt of 15 years ago.

So it's a good job we're about to throw it all out and start again, eh folks?

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by tetromino_ on Thursday March 23, 2017 @06:15PM (#13944836)
If by "responsive, fast, reliable" you mean awful screen tearing when you mix X11, OpenGL, and/or video playback. Fixing it on any given machine is often possible through some voodoo and a hand-rolled combination of driver and software settings, but that voodoo works only for one specific combination of hardware and driver version, and every update means more rounds of trial and error...
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by fulafel on Friday March 24, 2017 @01:02AM (#13946730)
This is not because of X11 the protocol though, just implementation bugs. Thus not a good reason to start from scratch.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Friday March 24, 2017 @04:31AM (#13947481)
How would you suggest we fix the core pointer protocol? (It's not an extension)
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by bitwize on Thursday March 23, 2017 @06:57PM (#13945098)
It's the GNOME style of development: as soon as a bug appears which takes effort to fix, mark it EWONTFIX, declare it to be a symptom of the inherent brokenness of the current stack, then burn the whole thing to the ground and start over. Don't even let that which was burned fertilize new growth; it is tainted and must be purged entirely.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Thursday March 23, 2017 @07:08PM (#13945176)
How have you managed to make an argument about embedding a web browser about GNOME?

As it were, GNOME's IDE (which I wrote) uses 0% CPU at idle.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by aidenn0 on Friday March 24, 2017 @12:28AM (#13946601)
To be fair, the conversation had already shifted to X11/Wayland. GNOME does have a history of starting over from scratch every few years; you probably had a good reason for writing Builder instead of working on Anjuta, and that's just the way the GNOME community seems to do things.

This makes people, especially power users, disproportionately angry because when you rewrite something, it will be different (that's sort of the whole point);this is compounded by the fact that at the beginning it will be feature-poor compared to the older system.

"Why did you replace X with Y? With X, I could configure it to treat mouse-button-3 as mouse-button-2, but only when my USB mouse was not attached and I wasn't holding down any modifier keys."

See also: https://xkcd.com/1172/

Before I did any serious software development, I was on that side of the table being frustrated (I still cry a little inside any time I remember Galeon. Rest in Peace, my favorite browser).

I can also neither confirm nor deny that my windows are being decorated by sawfish and that I wrote a compositor in librep so that I could get modern features while using it.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Friday March 24, 2017 @01:18AM (#13946810)
> GNOME does have a history of starting over from scratch every few years;

The GNOME project will be 20 years old in a couple of months. So while it might feel like "every few years", we really don't change direction all that often.

As you can imagine, those that show up to do work have a great deal of say in where the project goes.

> you probably had a good reason for writing Builder instead of working on Anjuta, and that's just the way the GNOME community seems to do things.

> This makes people, especially power users, disproportionately angry because when you rewrite something

You've sort of made my argument for not changing Anjuta over the years. We knew the amount of stuff that had to be changed would leave both the code-base and UI looking very little like Anjuta. Best to let people continue using it in the mean time.

> (I still cry a little inside any time I remember Galeon.

It lives on as Epiphany and is the primary driver of the WebKitGtk backend.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by killin_dan on Thursday March 23, 2017 @09:50PM (#13945926)
Gedit is fantastic. Thanks for all the work on it. I used it for years before VS Code, and I still use it outside of work on my personal projects.

Amazing how much work you can get done by just typing the damn code into the editor, sometimes.

However, writing typescript in vscode genuinely changed the way I think about editors. It's a smalltalkish sort of feeling where my code (at least the textual level) lives and breathes in the editor, automatic tooltips that are actually relevant, etc.

Idk. I like both.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Thursday March 23, 2017 @10:12PM (#13946027)
I work on Builder, not Gedit. However, Gedit does get various features as we push them up into Gtk/GtkSourceView. The overview map is one such example. The pixelcache in GtkTextView enabling smooth 60fps scrolling is another.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Thursday March 23, 2017 @07:06PM (#13945160)
> Not to mention network transparency when I need it

You realize that no X client draws like this nor has for 20 years right? They all use xshm to upload pixels so this "network transparency" is just buffer copying over the network. Not entirely different from a texture upload to a GPU.

> So it's a good job we're about to throw it all out and start again, eh folks?

Yes, by those of us who have been working on the same platform you claim to love, for the better part of a couple decades.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by zbuf on Thursday March 23, 2017 @08:31PM (#13945605)
> You realize that no X client draws like this nor has for 20 years right? They all use xshm to upload pixels [...]

You seem to be misinformed. Of the applications I mentioned, the main ones (gitk, xterm, emacs, xosview) are not doing that; seen clearly by analysing the X traffic.

Of course, some of these could be built with an optional Qt front-end, in which case I would not be surprised.

So you stated clearly "all" applications (for "20 years") which is provably incorrect; and I home in on this because it's a recurrence of another 'well, you never had it before' argument (that really might be better directed at the decaying state of X11 client toolkits)

X11 isn't perfect, I have no doubt something better can be engineered (especially if it involves those who worked on X11). But people are missing the point that to replace X11 is a different matter from designing a better one. It involves acknowledging those who are quietly and successfully using X11 on a daily basis for the majority of their work and existing applications -- not telling us how wrong we are.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Thursday March 23, 2017 @09:12PM (#13945767)
That's precisely why I stated 20 years. Those programs were written before that and largely haven't changed since.

If you wan't anti-aliasing in any of those above (gitk/emacs come to mind) you'll be doing client side rendering of fonts and copying pixels.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by monochromatic on Thursday March 23, 2017 @09:16PM (#13945781)
> no X client draws like this nor has for 20 years

If something was written a long time ago and hasn't changed in this respect, BUT is still widely used... you can't say that "no X client draws like this nor has for 20 years."

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by fulafel on Friday March 24, 2017 @01:06AM (#13946750)
"Copying pixels" is the dominant mode of operation in other remote GUI protocols like RDP, so it's not the end of the world.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by bitwize on Friday March 24, 2017 @01:53AM (#13946971)
Actually, RDP is GDI over the wire, which is not too dissimilar from X.

RDP has efficiency gains because clients send pixmaps over the wire to be stored on the server, and then send draw calls to display those pixmaps in certain places, composing a display. You can do this with X11 too, but the GTK developers don't want to because using the protocol is hard ;_;

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Friday March 24, 2017 @06:36AM (#13947953)
gtk+ certainly does use server-side textures and positioned draws. That is why the documentation is so adamant about using API like create_similar_surface().

Even the pixelcache uses server-side textures when available.

This is what Xshm does and why everything modern uses it. You get a server-side texture, but mapped into client address space so you can do direct draws and then XCopyArea() into your final location for double-buffering.

But gtk+ isn't really in the position to be able to control everything so precisely all the way down the driver stack to network transparency layers. So unless you connect to our process directly, like the HTML5 broadway backend, there is only so much we can do.

The broadway backend does employ various techniques to reduce the amount of content passed using a sort of rolling hash.

https://git.gnome.org/browse/gtk+/tree/gdk/broadway/broadway...

I expect forthcoming app/display network transparency layers in GNOME's Wayland compositor to employ a similar strategy.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Friday March 24, 2017 @01:22AM (#13946825)
Indeed. Especially since TCP-based X would require that you stall operations if you drop a packet so that draw-ordering is preserved.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by fulafel on Friday March 24, 2017 @01:37AM (#13946902)
If you want to optimize for choppy networks that have too much packet loss for interactive TCP applications , then the current X11 is not a good fit. But that would be a whole different niche.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by digi_owl on Friday March 24, 2017 @12:21PM (#13949983)
Could have sworn that there exist multiple takes on extensions for that, but none that has been rolled into Xorg proper. This either because lisencing, or because the current devs have GPU stars in their eyes.

BTW, it is downright funny how just about every Gnome guy i have encountered online seems to come across a pedantic grump. that would not know a joke if it fell on his head...

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Friday March 24, 2017 @05:24PM (#13952337)
Interesting how one person is a common denominator in all those interactions ;)
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by digi_owl on Sunday March 26, 2017 @10:35AM (#13960967)
And most of the comment gets ignored for a cheap retort, as expected.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by audidude on Sunday March 26, 2017 @05:45PM (#13963482)
you've mentioned something i've not heard about without linking to it or providing a name to help me find it myself. so i'm not sure what you'd like from me.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by firman on Friday March 24, 2017 @04:55AM (#13947560)
It is reminding me that webkit is grand child of QT. QT > KDE > khtml > webkit
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by theoh on Thursday March 23, 2017 @09:06PM (#13945736)
In 2000, I don't think many open source X clients (typically Linux stuff) used xshm. Not using X any more, I can't really comment on the current scene. But apart from things like MAME and vlc, what app needs it? And web browsers, of course.

(Accelerating OpenGL in hardware but displaying in an X11 window is a different question.)

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by ldev on Thursday March 23, 2017 @06:18PM (#13944856)
> X11 runs really well these days -- responsive, fast, reliable

Well, you haven't seen Windows then - the graphics stack is phenomenal and a marvel of engineering. nVidia drivers crash? I only get a second of black screen and then resume my work. Yep, that's right - no other GUI program crashed, I didn't had to do anything, literally just 1 second of black screen.

Oh and you can have one window on two monitors and both parts of window will have full vsync - insane, huh? :)

It's scary how good Windows is.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by charrondev on Thursday March 23, 2017 @06:53PM (#13945080)
I don't much about graphic stacks, but in my experience the best, as least from the perspective of someone using multiple HiDPI displays macOS is far and away the best. Many windows applications don't scale properly or if they do they require special settings to do so. If you have monitors with different levels of scaling your going to have a terrible time on windows.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by boterock on Thursday March 23, 2017 @11:50PM (#13946441)
On the other hand, connecting a 4k display in windows will default to configure it at 200% scaling, in mac it defaults to render everything tiny as ants.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Neeek on Friday March 24, 2017 @12:06AM (#13946524)
I think it's only 150%, currently running windows on a 28" 4k monitor makes me think 200% would be too much?

Oh I should also add that I haven't ever had any of the DPI issues the parent's parent is referencing. The only problem with multiple display DPI in Windows 10 is the shockingly bad fuzz you get on your secondary display from the thing being rendered either smaller or larger than normal (depending on whether the 4k is your primary or secondary) and then scaled up or down to fit the monitor.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by ReverseCold on Friday March 24, 2017 @12:44AM (#13946660)
It may somehow be detecting the size of the display. My 13" laptop likes 250% scaling, while my 27" monitor likes 150%.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Neeek on Friday March 24, 2017 @12:52AM (#13946693)
That would make sense, your DPI scaling is all to do with readability after all :)
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by jahnu on Friday March 24, 2017 @07:12AM (#13948104)
Windows 10 refuses to work properly with my 4K Dell monitor.

After it goes to sleep, then I wake it up all open Windows have been resized into a tiny part of the screen and scaling goes weird.

https://duckduckgo.com/?q=windows+4k+monitor+resize+after+sl...

Terrible.

Having said that on macOS my external 5K LG monitor is causing complete system crashes now and again :(

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by nikanj on Friday March 24, 2017 @11:48AM (#13949694)
I have a 43" 4k screen. It's near impossible to make Windows NOT use scaling, even if you disable it everywhere, the next Windows updates usually reset your carefully created registry hacks.

I wish Windows based scaling on DPI instead of resolution, the system seems to be aware of both. On a more general level, I wish there was any hope of passing feedback to Microsoft/Apple/etc.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by rl3 on Friday March 24, 2017 @02:48AM (#13947161)
>... in mac it defaults to render everything tiny as ants.

I'm a fan of no DPI scaling (100%) at 4K, at least on my 27" monitor. It takes 2-3 months of getting used to, but once your brain and eyes adapt, significantly lower dot pitches become completely unusable. The only thing I change is bumping up my terminal or editor's default font size a tad.

That said, I'm not sure how people with 24" 4K monitors do it without DPI scaling. I'd probably even prefer 30" myself.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by rl3 on Friday March 24, 2017 @12:04PM (#13949852)
>...significantly lower dot pitches become completely unusable.

Correction/clarification: significantly higher* dot pitches, as in lower pixel density. "Completely unusable" was meant in the sense of how it'd feel to return to 800x600 after being accustomed to 1080p. 4K is four times 1080p, so it's roughly comparable.

It wasn't my intention to offend anyone with poor eyesight, or suggest that people ruin theirs. Just that it's possible to get used to really low (dense) dot pitches, and once you do it's simultaneously really enjoyable and weird at the same time.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Yaggo on Friday March 24, 2017 @05:21AM (#13947648)
I once used 15" MBPr without DPI scaling (2880x1440 native res) for a while. Then I became too worried about my eyes.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by signal11 on Friday March 24, 2017 @06:45AM (#13947994)
As someone who remembers NT4 video driver crashes bringing down the whole system, when I saw Windows 10 recover from a video driver (yes, nVidia) crash I was massively impressed.

There's always room to improve but I'm really happy with the stability improvements they've put in.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by bitexploder on Thursday March 23, 2017 @07:48PM (#13945406)
FWIW my graphics drivers crashes on Ubuntu always recover. Even a complete GPU hang. It sees the driver is hung and restarts it causing a few seconds of minor glitching.

Configuring X is not for the faint of heart, but in Unity it is basically magical and deals with HiDPI displays, etc. just fine. Feature for feature it is very similar to Win or Mac on the display and GPU driver front. The total package still feels rougher around the edges, but it is still good.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Neeek on Friday March 24, 2017 @01:00AM (#13946718)
My only issue with configuring X is that 'load "glx"' will not fetch the correct libglx.so with nvidia drivers loaded unless you tell it to go looking in /usr/lib/nvidia-[VERSION]/ :| took me a very very long time to get GLX working on my setup.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by maskros on Friday March 24, 2017 @07:41AM (#13948236)
Yes, but only if you have the Aero compositor turned on... which adds at least one frame of latency to everything. Without Aero, Chrome can't play video without tearing like crazy. Oh, and that white pixel in the top left corner of the screen if you've got Aero turned on but turned off the annoying as crap transparent windows. Yeah, scary good...
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by insulanus on Thursday March 23, 2017 @06:49PM (#13945061)
Yes, and it only took 30 years, too!
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by yoklov on Friday March 24, 2017 @11:40AM (#13949626)
Windows' stack is still a ways from being reliable in a lot of somewhat important cases like (real) fullscreen, but it's certainly miles beyond X11 and Linux.

(I don't have enough experience with Mac's to speak to it).

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by flukus on Thursday March 23, 2017 @07:45PM (#13945391)
I think that's a case of necessity being the mother of invention. IME the windows 10 drivers crash much more frequently than the linux or windows 7 ones ever did.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by BHSPitMonkey on Thursday March 23, 2017 @07:53PM (#13945432)
I don't think it's fair to blame the OS for driver crashes. Those are a result of third parties and can happen on any platform.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by flukus on Thursday March 23, 2017 @08:45PM (#13945655)
That varies on the OS/driver/hardware, but IMO, the new AMD graphics drivers being in the kernel tree are the way to go, or something similar like a partnership between MS/AMD/Nvidia.

As a consumer it's incredibly frustrating to have a buggy driver and not know who is responsible. Is it MS? Windows comes with a lot of drivers so blaming MS seems fair. Is it the hardware manufacturer? Sometimes you can get the latest drivers but the OEM hardware isn't quite standard so you're screwed. Is the OEM to blame? Usually, because they have their own driver update system, but then the question is why can't they use the native windows update system?

The current situation on windows seems to be that no one is responsible.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Macha on Friday March 24, 2017 @01:29PM (#13950618)
> then the question is why can't they use the native windows update system?

Cynical answer, and I will grant that gpu vendors are less bad than e.g. printer or smartphone drivers, but it just distributes drivers and so doesn't provide all the opportunities to upsell/advertise to/lock in the users that their bundled crap they can pair with the driver with their own installer allows

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by signal11 on Friday March 24, 2017 @08:51AM (#13948529)
Many vendors do use the Windows Update system. Looking at my old Windows 10 box, in the last three months it's received display driver updates from Intel and nVidia (it's an Optimus system so yay, twice the driver update joy). It's also got a mouse driver update from something called ELAN.

Also, Windows has this thing called minidrivers where Microsoft essentially writes a chunk of your driver for you (the generic chunk), and you only have to write the bits specific to your device. The idea is that Microsoft could QA their drivers better than J. Random OEM ever could, and so this'd reduce cost for OEMs and also make the Windows platform more stable.

https://msdn.microsoft.com/en-us/windows/hardware/drivers/ge...

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by jamesgeck0 on Thursday March 23, 2017 @09:20PM (#13945790)
You're making this harder than it needs to be. All Windows drivers are signed. Blame the party that signed the buggy driver.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by flukus on Friday March 24, 2017 @03:13AM (#13947231)
The point is, users will blame windows because they don't know what a graphics driver is or that they have one, so MS took steps to avoid people thinking windows is buggy. MS has a long history of this, going as far as reproducing bugs.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by BHSPitMonkey on Friday March 24, 2017 @05:56PM (#13952559)
You sign an executable to attest that it is authentic, not that it is bug-free.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Yaggo on Friday March 24, 2017 @05:17AM (#13947636)
X11 may "run really well these days" if your reference is X11 twenty years ago, but if you compare X11 to e.g. macOS, it's pretty obvious why Wayland is needed.

X11 network transparency was nice feature when 10 mbit ethernet was hot as pizza, but these days remote desktop protocols offer more practical alternative.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Hydraulix989 on Friday March 24, 2017 @12:10AM (#13946547)
To be fair, X11 can't handle multiple displays with mixed DPI.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by nitrogen on Friday March 24, 2017 @12:17AM (#13946563)
You sort of can with xrandr scaling.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by truncate on Friday March 24, 2017 @04:59AM (#13947578)
Last time I did that, my CPU was always spinning and the rendering looked blurry and non-crisp. Now I just prefer to reduce my emacs and terminal font size, and keep Chrome in one display forever.