1"use strict";(self.webpackChunkelectronjs=self.webpackChunkelectronjs||[]).push([["2808"],{75090(e,t,n){n.r(t),n.d(t,{metadata:()=>o,default:()=>u,frontMatter:()=>r,contentTitle:()=>a,toc:()=>p,assets:()=>c});var o=JSON.parse('{"id":"latest/api/structures/display","title":"Display Object","description":"","source":"@site/docs/latest/api/structures/display.md","sourceDirName":"latest/api/structures","slug":"/latest/api/structures/display","permalink":"/docs/latest/api/structures/display","draft":false,"unlisted":false,"editUrl":"https://github.com/electron/electron/edit/main/docs/api/structures/display.md","tags":[],"version":"current","frontMatter":{"title":"Display Object","description":"","slug":"display","hide_title":false},"sidebar":"api","previous":{"title":"DesktopCapturerSource Object","permalink":"/docs/latest/api/structures/desktop-capturer-source"},"next":{"title":"EnableHeapProfilingOptions Object","permalink":"/docs/latest/api/structures/enable-heap-profiling-options"}}'),l=n(74848),i=n(28453),s=n(40329);let r={title:"Display Object",description:"",slug:"display",hide_title:!1},a="Display Object",c={},p=[];function f(e){let t={code:"code",h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.header,{children:(0,l.jsx)(t.h1,{id:"display-object",children:"Display Object"})}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"accelerometerSupport"})," string - Can be ",(0,l.jsx)(t.code,{children:"available"}),", ",(0,l.jsx)(t.code,{children:"unavailable"}),", ",(0,l.jsx)(t.code,{children:"unknown"}),"."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"bounds"})," ",(0,l.jsx)(s.A,{url:"/docs/latest/api/structures/rectangle",title:"Rectangle",content:'{"type":"root","children":[{"type":"element","tagName":"h1","properties":{},"children":[{"type":"text","value":"Rectangle Object"}]},{"type":"text","value":"\\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"x","position":{"start":{"line":10,"column":3,"offset":107},"end":{"line":10,"column":6,"offset":110}}}],"position":{"start":{"line":10,"column":3,"offset":107},"end":{"line":10,"column":6,"offset":110}}},{"type":"text","value":" number - The x coordinate of the origin of the rectangle (must be an integer).","position":{"start":{"line":10,"column":6,"offset":110},"end":{"line":10,"column":85,"offset":189}}}],"position":{"start":{"line":10,"column":1,"offset":105},"end":{"line":10,"column":85,"offset":189}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"y","position":{"start":{"line":11,"column":3,"offset":192},"end":{"line":11,"column":6,"offset":195}}}],"position":{"start":{"line":11,"column":3,"offset":192},"end":{"line":11,"column":6,"offset":195}}},{"type":"text","value":" number - The y coordinate of the origin of the rectangle (must be an integer).","position":{"start":{"line":11,"column":6,"offset":195},"end":{"line":11,"column":85,"offset":274}}}],"position":{"start":{"line":11,"column":1,"offset":190},"end":{"line":11,"column":85,"offset":274}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"width","position":{"start":{"line":12,"column":3,"offset":277},"end":{"line":12,"column":10,"offset":284}}}],"position":{"start":{"line":12,"column":3,"offset":277},"end":{"line":12,"column":10,"offset":284}}},{"type":"text","value":" number - The width of the rectangle (must be an integer).","position":{"start":{"line":12,"column":10,"offset":284},"end":{"line":12,"column":68,"offset":342}}}],"position":{"start":{"line":12,"column":1,"offset":275},"end":{"line":12,"column":68,"offset":342}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"height","position":{"start":{"line":13,"column":3,"offset":345},"end":{"line":13,"column":11,"offset":353}}}],"position":{"start":{"line":13,"column":3,"offset":345},"end":{"line":13,"column":11,"offset":353}}},{"type":"text","value":" number - The height of the rectangle (must be an integer).","position":{"start":{"line":13,"column":11,"offset":353},"end":{"line":13,"column":70,"offset":412}}}],"position":{"start":{"line":13,"column":1,"offset":343},"end":{"line":13,"column":70,"offset":412}}},{"type":"text","value":"\\n"}],"position":{"start":{"line":10,"column":1,"offset":105},"end":{"line":13,"column":70,"offset":412}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":14,"column":1,"offset":413}}}'})," - the bounds of the display in DIP points."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"colorDepth"})," number - The number of bits per pixel."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"colorSpace"})," string - represent a color space (three-dimensional object which contains all realizable color combinations) for the purpose of color conversions."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"depthPerComponent"})," number - The number of bits per color component."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"detected"})," boolean - ",(0,l.jsx)(t.code,{children:"true"})," if the display is detected by the system."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"displayFrequency"})," number - The display refresh rate."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"id"})," number - Unique identifier associated with the display. A value of -1 means the display is invali
1d or the correct ",(0,l.jsx)(t.code,{children:"id"})," is not yet known, and a value of -10 means the display is a virtual display assigned to a unified desktop."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"internal"})," boolean - ",(0,l.jsx)(t.code,{children:"true"})," for an internal display and ",(0,l.jsx)(t.code,{children:"false"})," for an external display."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"label"})," string - User-friendly label, determined by the platform."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"maximumCursorSize"})," ",(0,l.jsx)(s.A,{url:"/docs/latest/api/structures/size",title:"Size",content:'{"type":"root","children":[{"type":"element","tagName":"h1","properties":{},"children":[{"type":"text","value":"Size Object"}]},{"type":"text","value":"\\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"width","position":{"start":{"line":10,"column":3,"offset":92},"end":{"line":10,"column":10,"offset":99}}}],"position":{"start":{"line":10,"column":3,"offset":92},"end":{"line":10,"column":10,"offset":99}}},{"type":"text","value":" number","position":{"start":{"line":10,"column":10,"offset":99},"end":{"line":10,"column":17,"offset":106}}}],"position":{"start":{"line":10,"column":1,"offset":90},"end":{"line":10,"column":17,"offset":106}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"height","position":{"start":{"line":11,"column":3,"offset":109},"end":{"line":11,"column":11,"offset":117}}}],"position":{"start":{"line":11,"column":3,"offset":109},"end":{"line":11,"column":11,"offset":117}}},{"type":"text","value":" number","position":{"start":{"line":11,"column":11,"offset":117},"end":{"line":11,"column":18,"offset":124}}}],"position":{"start":{"line":11,"column":1,"offset":107},"end":{"line":11,"column":18,"offset":124}}},{"type":"text","value":"\\n"}],"position":{"start":{"line":10,"column":1,"offset":90},"end":{"line":11,"column":18,"offset":124}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":12,"column":1,"offset":125}}}'})," - Maximum cursor size in native pixels."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"nativeOrigin"})," ",(0,l.jsx)(s.A,{url:"/docs/latest/api/structures/point",title:"Point",content:'{"type":"root","children":[{"type":"element","tagName":"h1","properties":{},"children":[{"type":"text","value":"Point Object"}]},{"type":"text","value":"\\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"x","position":{"start":{"line":10,"column":3,"offset":95},"end":{"line":10,"column":6,"offset":98}}}],"position":{"start":{"line":10,"column":3,"offset":95},"end":{"line":10,"column":6,"offset":98}}},{"type":"text","value":" number","position":{"start":{"line":10,"column":6,"offset":98},"end":{"line":10,"column":13,"offset":105}}}],"position":{"start":{"line":10,"column":1,"offset":93},"end":{"line":10,"column":13,"offset":105}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"y","position":{"start":{"line":11,"column":3,"offset":108},"end":{"line":11,"column":6,"offset":111}}}],"position":{"start":{"line":11,"column":3,"offset":108},"end":{"line":11,"column":6,"offset":111}}},{"type":"text","value":" number","position":{"start":{"line":11,"column":6,"offset":111},"end":{"line":11,"column":13,"offset":118}}}],"position":{"start":{"line":11,"column":1,"offset":106},"end":{"line":11,"column":13,"offset":118}}},{"type":"text","value":"\\n"}],"position":{"start":{"line":10,"column":1,"offset":93},"end":{"line":11,"column":13,"offset":118}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Both "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"x","position":{"start":{"line":14,"column":8,"offset":137},"end":{"line":14,"column":11,"offset":140}}}],"position":{"start":{"line":14,"column":8,"offset":137},"end":{"line":14,"column":11,"offset":140}}},{"type":"text","value":" and ","position":{"start":{"line":14,"column":11,"offset":140},"end":{"line":14,"column":16,"offset":145}}},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"y","position":{"start":{"line":14,"column":16,"offset":145},"end":{"line":14,"column":19,"offset":148}}}],"position":{"start":{"line":14,"column":16,"offset":145},"end":{"line":14,"column":19,"offset":148}}},{"type":"text","value":" must be whole integers, when providing a point object\\nas input to an Electron API we will automatically round your ","position":{"start":{"line":14,"column":19,"offset":148},"end":{"line":15,"column":64,"offset":266}}},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"x","position":{"start":{"line":15,"column":64,"offset":266},"end":{"line":15,"column":67,"offset":269}}}],"position":{"start":{"line":15,"column":64,"offset":266},"end":{"line":15,"column":67,"offset":269}}},{"type":"text","value":" and ","position":{"start":{"line":15,"column":67,"offset":269},"end":{"line":15,"column":72,"offset":274}}},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"y","position":{"start":{"line":15,"column":72,"offset":274},"end":{"line":15,"column":75,"offset":277}}}],"position":{"start":{"line":15,"column":72,"offset":274},"end":{"line":15,"column":75,"offset":277}}},{"type":"text","value":" values\\nto the nearest whole integer.","position":{"start":{"line":15,"column":75,"offset":277},"end":{"line":16,"column":32,"offset":316}}}]}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":17,"column":1,"offset":317}}}'})," - Returns the display's origin in pixel coordinates. Only available on windowing systems like X11 that position displays in pixel coordinates."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"rotation"})," number - Can be 0, 90, 180, 270, represents screen rotation in\nclock-wise degrees."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"scaleFactor"})," number - Output device's pixel scale factor."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"touchSupport"})," string - Can be ",(0,l.jsx)(t.code,{children:"available"}),", ",(0,l.jsx)(t.code,{children:"unavailable"}),", ",(0,l.jsx)(t.code,{children:"unknown"}),"."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"monochrome"})," boolean - Whether or not the display is a monochrome display."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"size"})," ",(0,l.jsx)(s.A,{url:"/docs/latest/api/structures/size",title:"Size",content:'{"type":"root","children":[{"type":"element","tagName":"h1","properties":{},"children":[{"type":"text","value":"Size Object"}]},{"type":"text","value":"\\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"width","position":{"start":{"line":10,"column":3,"offset":92},"end":{"line":10,"column":10,"offset":99}}}],"position":{"start":{"line":10,"column":3,"offset":92},"end":{"line":10,"column":10,"offset":99}}},{"type":"text","value":" number","position":{"start":{"line":10,"column":10,"offset":99},"end":{"line":10,"column":17,"offset":106}}}],"position":{"start":{"line":10,"column":1,"offset":90},"end":{"line":10,"column":17,"offset":106}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"height","position":{"start":{"line":11,"column":3,"offset":109},"end":{"line":11,"column":11,"offset":117}}}],"position":{"start":{"line":11,"column":3,"offset":109},"end":{"line":11,"column":11,"offset":117}}},{"type":"text","value":" number","position":{"start":{"line":11,"column":11,"offset":117},"end":{"line":11,"column":18,"offset":124}}}],"position":{"start":{"line":11,"column":1,"offset":107},"end":{"line":11,"column":18,"offset":124}}},{"type":"text","value":"\\n"}],"position":{"start":{"line":10,"column":1,"offset":90},"end":{"line":11,"column":18,"offset":124}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":12,"column":1,"offset":125}}}'})]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"workArea"})," ",(0,l.jsx)(s.A,{url:"/docs/latest/api/structures/rectangle",title:"Rectangle",content:'{"type":"root","children":[{"type":"element","tagName":"h1","properties":{},"children":[{"type":"text","value":"Rectangle Object"}]},{"type":"text","value":"\\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"x","position":{"start":{"line":10,"column":3,"offset":107},"end":{"line":10,"column":6,"offset":110}}}],"position":{"start":{"line":10,"column":3,"offset":107},"end":{"line":10,"column":6,"offset":110}}},{"type":"text","value":" number - The x coordinate of the origin of the rectangle (must be an integer).","position":{"start":{"line":10,"column":6,"offset":110},"end":{"line":10,"column":85,"offset":189}}}],"position":{"start":{"line":10,"column":1,"offset":105},"end":{"line":10,"column":85,"offset":189}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"y","position":{"start":{"line":11,"column":3,"offset":192},"end":{"line":11,"column":6,"offset":195}}}],"position":{"start":{"line":11,"column":3,"offset":192},"end":{"line":11,"column":6,"offset":195}}},{"type":"text","value":" number - The y coordinate of the origin of the rectangle (must be an integer).","position":{"start":{"line":11,"column":6,"offset":195},"end":{"line":11,"column":85,"offset":274}}}],"position":{"start":{"line":11,"column":1,"offset":190},"end":{"line":11,"column":85,"offset":274}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"width","position":{"start":{"line":12,"column":3,"offset":277},"end":{"line":12,"column":10,"offset":284}}}],"position":{"start":{"line":12,"column":3,"offset":277},"end":{"line":12,"column":10,"offset":284}}},{"type":"text","value":" number - The width of the rectangle (must be an integer).","position":{"start":{"line":12,"column":10,"offset":284},"end":{"line":12,"column":68,"offset":342}}}],"position":{"start":{"line":12,"column":1,"offset":275},"end":{"line":12,"column":68,"offset":342}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"height","position":{"start":{"line":13,"column":3,"offset":345},"end":{"line":13,"column":11,"offset":353}}}],"position":{"start":{"line":13,"column":3,"offset":345},"end":{"line":13,"column":11,"offset":353}}},{"type":"text","value":" number - The height of the rectangle (must be an integer).","position":{"start":{"line":13,"column":11,"offset":353},"end":{"line":13,"column":70,"offset":412}}}],"position":{"start":{"line":13,"column":1,"offset":343},"end":{"line":13,"column":70,"offset":412}}},{"type":"text","value":"\\n"}],"position":{"start":{"line":10,"column":1,"offset":105},"end":{"line":13,"column":70,"offset":412}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":14,"column":1,"offset":413}}}'})," - the work area of the display in DIP points."]}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.code,{children:"workAreaSize"})," ",(0,l.jsx)(s.A,{url:"/docs/latest/api/structures/size",title:"Size",content:'{"type":"root","children":[{"type":"element","tagName":"h1","properties":{},"children":[{"type":"text","value":"Size Object"}]},{"type":"text","value":"\\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"width","position":{"start":{"line":10,"column":3,"offset":92},"end":{"line":10,"column":10,"offset":99}}}],"position":{"start":{"line":10,"column":3,"offset":92},"end":{"line":10,"column":10,"offset":99}}},{"type":"text","value":" number","position":{"start":{"line":10,"column":10,"offset":99},"end":{"line":10,"column":17,"offset":106}}}],"position":{"start":{"line":10,"column":1,"offset":90},"end":{"line":10,"column":17,"offset":106}}},{"type":"text","value":"\\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"height","position":{"start":{"line":11,"column":3,"offset":109},"end":{"line":11,"column":11,"offset":117}}}],"position":{"start":{"line":11,"column":3,"offset":109},"end":{"line":11,"column":11,"offset":117}}},{"type":"text","value":" number","position":{"start":{"line":11,"column":11,"offset":117},"end":{"line":11,"column":18,"offset":124}}}],"position":{"start":{"line":11,"column":1,"offset":107},"end":{"line":11,"column":18,"offset":124}}},{"type":"text","value":"\\n"}],"position":{"start":{"line":10,"column":1,"offset":90},"end":{"line":11,"column":18,"offset":124}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":12,"column":1,"offset":125}}}'})," - The size of the work area."]}),"\n"]}),"\n",(0,l.jsxs)(t.p,{children:["The ",(0,l.jsx)(t.code,{children:"Display"})," object represents a physical display connected to the system. A\nfake ",(0,l.jsx)(t.code,{children:"Display"})," may exist on a headless system, or a ",(0,l.jsx)(t.code,{children:"Display"})," may correspond to\na remote, virtual display."]})]})}function u(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(f,{...e})}):f(e)}},40329(e,t,n){n.d(t,{A:()=>p});var o=n(74848),l=n(20053),i=n(96540),s=n(75392),r=n.n(s),a=n(83561);let c=e=>(0,o.jsx)("article",{ref:e.innerRef,id:"structures-tooltip",role:"tooltip",className:(0,l.A)("alert","alert--info","shadow--md","card_ZoSr"),style:e.position,children:(0,o.jsx)("div",{className:"card__body",dangerouslySetInnerHTML:{__html:(0,a.V)(JSON.parse(e.content))}})}),p=function(e){let{Portal:t}=r()(),n=(0,i.useRef)(null),l=(0,i.useRef)(null),[s,a]=(0,i.useState)(!1),[p,f]=(0,i.useState)(void 0);(0,i.useEffect)(()=>
1{if(s){let e={x:0,y:0},t=n.current.getBoundingClientRect(),o=window.innerHeight/2<t.y,i=window.innerWidth/2<t.x;o?e.y=l.current.clientHeight+-2:e.y=-t.height- -2,i?e.x=l.current.clientWidth:e.x=0,f({top:n.current.offsetTop-e.y,left:n.current.offsetLeft-e.x})}},[s]);let u=(0,i.useCallback)(()=>{a(!0)},[]),d=(0,i.useCallback)(()=>{a(!1)},[]);return(0,o.jsxs)("a",{"aria-describedby":"structures-tooltip",href:e.url,ref:n,className:"link_nCrB",onMouseEnter:u,onMouseLeave:d,children:[e.title,!!s&&(0,o.jsx)(t,{children:(0,o.jsx)(c,{innerRef:l,position:p,...e})})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.