From 1ed1489831e32337c13fbcbac2c2562ac4163bd3 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 7 Sep 2020 20:19:51 +0200 Subject: [PATCH 01/63] Fix typo in GLFWwindowmaximizefun documentation Thanks brianzuvich! Fixes #1764. --- include/GLFW/glfw3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 46b72d28..7d9dee02 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -1483,7 +1483,7 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); * @endcode * * @param[in] window The window that was maximized or restored. - * @param[in] iconified `GLFW_TRUE` if the window was maximized, or + * @param[in] maximized `GLFW_TRUE` if the window was maximized, or * `GLFW_FALSE` if it was restored. * * @sa @ref window_maximize From 96f9f5c4b970140ab5380fb9886ba787c8698937 Mon Sep 17 00:00:00 2001 From: Siavash Eliasi Date: Thu, 3 Sep 2020 16:56:43 +0430 Subject: [PATCH 02/63] Migrate to Sass for Doxygen custom stylesheets Closes #1759. --- docs/extra.css | 2 +- docs/extra.css.map | 1 + docs/{extra.less => extra.scss} | 142 ++++++++++++++++---------------- 3 files changed, 73 insertions(+), 72 deletions(-) create mode 100644 docs/extra.css.map rename docs/{extra.less => extra.scss} (67%) diff --git a/docs/extra.css b/docs/extra.css index 97ce33d0..05c1938c 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -1 +1 @@ -.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover{background:none;text-shadow:none}.sm-dox a span.sub-arrow{border-color:#f2f2f2 transparent transparent transparent}.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow{border-color:#f60 transparent transparent transparent}.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #f60}.sm-dox ul a:hover{background:#666;text-shadow:none}.sm-dox ul.sm-nowrap a{color:#4d4d4d;text-shadow:none}#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator{border:none}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven{background:#f2f2f2}body{color:#4d4d4d}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top:0.5em;font-size:180%}h2{padding-top:0.5em;margin-bottom:0;font-size:140%}h3{padding-top:0.5em;margin-bottom:0;font-size:110%}.glfwheader{font-size:16px;min-height:64px;max-width:920px;padding:0 32px;margin:0 auto;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("https://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 0 0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}.glfwnavbar{padding-left:0}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#main-nav{max-width:960px;margin:0 auto;font-size:13px}#main-menu{max-width:920px;margin:0 auto;font-size:13px}.memtitle{display:none}.memproto,.memname{font-weight:bold;text-shadow:none}#main-menu{min-height:36px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li{color:#f2f2f2}#main-menu li ul.sm-nowrap li a{color:#4d4d4d}#main-menu li ul.sm-nowrap li a:hover{color:#f60}#main-menu>li:last-child{margin:0 0 0 auto}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,table.markdownTable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;text-align:left;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable,table.markdownTable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover{color:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe599}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e5c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e599bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce5}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px} +.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover{background:none;text-shadow:none}.sm-dox a span.sub-arrow{border-color:#f2f2f2 transparent transparent transparent}.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow{border-color:#f60 transparent transparent transparent}.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #f60}.sm-dox ul a:hover{background:#666;text-shadow:none}.sm-dox ul.sm-nowrap a{color:#4d4d4d;text-shadow:none}#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator{border:none}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven{background:#f2f2f2}body{color:#4d4d4d}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top:.5em;font-size:180%}h2{padding-top:.5em;margin-bottom:0;font-size:140%}h3{padding-top:.5em;margin-bottom:0;font-size:110%}.glfwheader{font-size:16px;min-height:64px;max-width:920px;padding:0 32px;margin:0 auto;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("https://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 0 0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}.glfwnavbar{padding-left:0}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#main-nav{max-width:960px;margin:0 auto;font-size:13px}#main-menu{max-width:920px;margin:0 auto;font-size:13px}.memtitle{display:none}.memproto,.memname{font-weight:bold;text-shadow:none}#main-menu{min-height:36px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li{color:#f2f2f2}#main-menu li ul.sm-nowrap li a{color:#4d4d4d}#main-menu li ul.sm-nowrap li a:hover{color:#f60}#main-menu>li:last-child{margin:0 0 0 auto}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,table.markdownTable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0%, #ff6600 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;text-align:left;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0%, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable,table.markdownTable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover{color:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0%, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0%, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe699}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0%, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e6c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0%, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e699bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0%, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce6}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px}/*# sourceMappingURL=extra.css.map */ diff --git a/docs/extra.css.map b/docs/extra.css.map new file mode 100644 index 00000000..7d10c5e2 --- /dev/null +++ b/docs/extra.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["extra.scss"],"names":[],"mappings":"AA8EA,4GACI,gBACA,iBAGJ,yBACC,yDAGD,6HACC,sDAGD,yIACC,sDAGD,mBACI,WA9EuB,KA+EvB,iBAGJ,uBACC,MAzFoB,QA0FjB,iBAGJ,6UACC,gBAGD,mJACC,YAGD,yHACC,iBAGD,sBACC,gBAGD,4LACC,UAGD,yCACC,aAGD,kMACC,WAnHgC,QAsHjC,KACC,MA1HoB,QA6HrB,sDACC,MA/Ge,QAgHf,mBAGD,GACE,iBACA,eAGF,GACE,iBACA,gBACA,eAGF,GACE,iBACA,gBACA,eAGF,YACC,eACA,gBACA,gBACA,eACA,cAEA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,UACC,iBACA,mBACA,MA/J0B,KAgK1B,gBACA,qEAGD,YACC,qBACA,kBACA,YAGD,yBACC,WAGD,oCACC,iBACA,gBACA,cACA,MAlL0B,KAqL3B,YACC,eAGD,8CACC,qBAGD,mBACC,MA9L0B,KAiM3B,eACC,kBACA,YACA,eAGD,KACC,WAxM0B,KA2M3B,UACC,gBACA,cACA,eAGD,WACC,gBACA,cACA,eAGD,UACI,aAGJ,mBACI,iBACA,iBAGJ,WACC,gBACA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,mEACC,MA9OgC,QAiPjC,gCACC,MArPoB,QAwPrB,sCACC,MAjOoB,KAoOrB,yBACC,kBAGD,UACC,iBAGD,wBACC,gBACA,cACA,eACA,qBAGD,uDACC,gEACA,+BACA,+BACA,gBACA,MArPgB,KAwPjB,mBACC,MA5PoB,KA6PpB,aACA,kBACA,yBAGD,QACC,WACA,WAGD,WACC,iBAGD,WACC,mBAGD,WACC,cACA,eACA,qBAGD,oCACC,gEACA,kCACA,2BACA,MAlSe,QAmSf,yBACA,kBAGD,WACC,MA3QuB,QA8QxB,cACC,sBACA,2BACA,4BACA,mBAGD,cACC,sBACA,+BACA,8BACA,gBAGD,mCACC,wBACA,iBACA,sBACA,kBAGD,gIACC,MAxToB,KAyTpB,qBAGD,cACC,wBACA,iBACA,sBACA,kBAGD,iBACC,WACA,4EAGD,oCApSC,gEACA,kCACA,cACA,yBAqSD,wBAxSC,gEACA,kCACA,cACA,yBAySD,qBA5SC,gEACA,kCACA,cACA,yBA6SD,gBAhTC,gEACA,kCACA,cACA,yBAiTD,iGACC,kBACA,YACA,2BACA,aAGD,kRACC,cAGD,SACC,oBAGD,0BACC,mBACA,kBACA,YACA,YACA,cACA,2BACA,aAGD,+CACC,MA1YoB,QA6YrB,+BACC,cAGD,sBACC,cAGD,+CACC,cACA,iBAGD,mBACC,cAGD,KACC,aACA","file":"extra.css"} \ No newline at end of file diff --git a/docs/extra.less b/docs/extra.scss similarity index 67% rename from docs/extra.less rename to docs/extra.scss index 8972c113..32993429 100644 --- a/docs/extra.less +++ b/docs/extra.scss @@ -1,79 +1,79 @@ // NOTE: Please use this file to perform modifications on default style sheets. // -// You need to install a few Ruby gems to generate extra.css from this file: -// gem install less therubyracer +// You need to install the official Sass CLI tool: +// npm install -g sass // // Run this command to regenerate extra.css after you're finished with changes: -// lessc --compress extra.less > extra.css +// sass --style=compressed extra.scss extra.css // // Alternatively you can use online services to regenerate extra.css. // Default text color for page contents -@default-text-color: hsl(0,0%,30%); +$default-text-color: hsl(0,0%,30%); // Page header, footer, table rows, inline codes and definition lists -@header-footer-background-color: hsl(0,0%,95%); +$header-footer-background-color: hsl(0,0%,95%); // Page header, footer links and navigation bar background -@header-footer-link-color: hsl(0,0%,40%); +$header-footer-link-color: hsl(0,0%,40%); // Doxygen navigation bar links -@navbar-link-color: @header-footer-background-color; +$navbar-link-color: $header-footer-background-color; // Page content background color -@content-background-color: hsl(0,0%,100%); +$content-background-color: hsl(0,0%,100%); // Bold, italic, h1, h2, ... and table of contents -@heading-color: hsl(0,0%,10%); +$heading-color: hsl(0,0%,10%); // Function, enum and macro definition separator -@def-separator-color: @header-footer-background-color; +$def-separator-color: $header-footer-background-color; // Base color hue -@base-hue: 24; +$base-hue: 24; // Default color used for links -@default-link-color: hsl(@base-hue,100%,50%); +$default-link-color: hsl($base-hue,100%,50%); // Doxygen navigation bar active tab -@tab-text-color: hsl(0,0%,100%); -@tab-background-color1: @default-link-color; -@tab-background-color2: lighten(spin(@tab-background-color1, 10), 10%); +$tab-text-color: hsl(0,0%,100%); +$tab-background-color1: $default-link-color; +$tab-background-color2: lighten(adjust-hue($tab-background-color1, 10), 10%); // Table borders -@default-border-color: @default-link-color; +$default-border-color: $default-link-color; // Table header -@table-text-color: @tab-text-color; -@table-background-color1: @tab-background-color1; -@table-background-color2: @tab-background-color2; +$table-text-color: $tab-text-color; +$table-background-color1: $tab-background-color1; +$table-background-color2: $tab-background-color2; // Table of contents, data structure index and prototypes -@toc-background-color1: hsl(0,0%,90%); -@toc-background-color2: lighten(@toc-background-color1, 5%); +$toc-background-color1: hsl(0,0%,90%); +$toc-background-color2: lighten($toc-background-color1, 5%); // Function prototype parameters color -@prototype-param-color: darken(@default-link-color, 25%); +$prototype-param-color: darken($default-link-color, 25%); // Message box color: note, pre, post and invariant -@box-note-color: hsl(103,80%,85%); +$box-note-color: hsl(103,80%,85%); // Message box color: warning and attention -@box-warning-color: hsl(34,80%,85%); +$box-warning-color: hsl(34,80%,85%); // Message box color: deprecated and bug -@box-bug-color: hsl(333,80%,85%); +$box-bug-color: hsl(333,80%,85%); // Message box color: todo and test -@box-todo-color: hsl(200,80%,85%); +$box-todo-color: hsl(200,80%,85%); // Message box helper function -.message-box(@base-color) { - background:linear-gradient(to bottom,lighten(@base-color, 5%) 0%,@base-color 100%); - box-shadow:inset 0 0 32px darken(@base-color, 5%); - color:darken(@base-color, 67%); - border:2px solid desaturate(darken(@base-color, 10%), 20%); +@mixin message-box($base-color){ + background:linear-gradient(to bottom,lighten($base-color, 5%) 0%,$base-color 100%); + box-shadow:inset 0 0 32px darken($base-color, 5%); + color:darken($base-color, 67%); + border:2px solid desaturate(darken($base-color, 10%), 20%); } .sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover { @@ -82,24 +82,24 @@ } .sm-dox a span.sub-arrow { - border-color:@navbar-link-color transparent transparent transparent; + border-color:$navbar-link-color transparent transparent transparent; } .sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow { - border-color:@default-link-color transparent transparent transparent; + border-color:$default-link-color transparent transparent transparent; } .sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow { - border-color:transparent transparent transparent @default-link-color; + border-color:transparent transparent transparent $default-link-color; } .sm-dox ul a:hover { - background:@header-footer-link-color; + background:$header-footer-link-color; text-shadow:none; } .sm-dox ul.sm-nowrap a { - color:@default-text-color; + color:$default-text-color; text-shadow:none; } @@ -128,15 +128,15 @@ div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.a } html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven { - background:@header-footer-background-color; + background:$header-footer-background-color; } body { - color:@default-text-color; + color:$default-text-color; } h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em { - color:@heading-color; + color:$heading-color; border-bottom:none; } @@ -175,7 +175,7 @@ h3 { #glfwhome { line-height:64px; padding-right:48px; - color:@header-footer-link-color; + color:$header-footer-link-color; font-size:2.5em; background:url("https://www.glfw.org/css/arrow.png") no-repeat right; } @@ -194,7 +194,7 @@ h3 { line-height:64px; margin-left:2em; display:block; - color:@header-footer-link-color; + color:$header-footer-link-color; } .glfwnavbar { @@ -206,7 +206,7 @@ h3 { } #titlearea,.footer { - color:@header-footer-link-color; + color:$header-footer-link-color; } address.footer { @@ -216,7 +216,7 @@ address.footer { } #top { - background:@header-footer-link-color; + background:$header-footer-link-color; } #main-nav { @@ -251,15 +251,15 @@ address.footer { } #main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li { - color:@navbar-link-color; + color:$navbar-link-color; } #main-menu li ul.sm-nowrap li a { - color:@default-text-color; + color:$default-text-color; } #main-menu li ul.sm-nowrap li a:hover { - color:@default-link-color; + color:$default-link-color; } #main-menu > li:last-child { @@ -274,22 +274,22 @@ div.contents,div.header { max-width:920px; margin:0 auto; padding:0 32px; - background:@content-background-color none; + background:$content-background-color none; } table.doxtable th,table.markdownTable th,dl.reflist dt { - background:linear-gradient(to bottom,@table-background-color2 0%,@table-background-color1 100%); - box-shadow:inset 0 0 32px @table-background-color1; - text-shadow:0 -1px 1px darken(@table-background-color1, 15%); + background:linear-gradient(to bottom,$table-background-color2 0%,$table-background-color1 100%); + box-shadow:inset 0 0 32px $table-background-color1; + text-shadow:0 -1px 1px darken($table-background-color1, 15%); text-align:left; - color:@table-text-color; + color:$table-text-color; } dl.reflist dt a.el { - color:@default-link-color; + color:$default-link-color; padding:.2em; border-radius:4px; - background-color:lighten(@default-link-color, 40%); + background-color:lighten($default-link-color, 40%); } div.toc { @@ -312,27 +312,27 @@ div.toc li { } div.toc,.memproto,div.qindex,div.ah { - background:linear-gradient(to bottom,@toc-background-color2 0%,@toc-background-color1 100%); - box-shadow:inset 0 0 32px @toc-background-color1; - text-shadow:0 1px 1px lighten(@toc-background-color2, 10%); - color:@heading-color; - border:2px solid @toc-background-color1; + background:linear-gradient(to bottom,$toc-background-color2 0%,$toc-background-color1 100%); + box-shadow:inset 0 0 32px $toc-background-color1; + text-shadow:0 1px 1px lighten($toc-background-color2, 10%); + color:$heading-color; + border:2px solid $toc-background-color1; border-radius:4px; } .paramname { - color:@prototype-param-color; + color:$prototype-param-color; } dl.reflist dt { - border:2px solid @default-border-color; + border:2px solid $default-border-color; border-top-left-radius:4px; border-top-right-radius:4px; border-bottom:none; } dl.reflist dd { - border:2px solid @default-border-color; + border:2px solid $default-border-color; border-bottom-right-radius:4px; border-bottom-left-radius:4px; border-top:none; @@ -341,41 +341,41 @@ dl.reflist dd { table.doxtable,table.markdownTable { border-collapse:inherit; border-spacing:0; - border:2px solid @default-border-color; + border:2px solid $default-border-color; border-radius:4px; } a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover { - color:@default-link-color; + color:$default-link-color; text-decoration:none; } div.directory { border-collapse:inherit; border-spacing:0; - border:2px solid @default-border-color; + border:2px solid $default-border-color; border-radius:4px; } hr,.memSeparator { height:2px; - background:linear-gradient(to right,@def-separator-color 0%,darken(@def-separator-color, 10%) 50%,@def-separator-color 100%); + background:linear-gradient(to right,$def-separator-color 0%,darken($def-separator-color, 10%) 50%,$def-separator-color 100%); } dl.note,dl.pre,dl.post,dl.invariant { - .message-box(@box-note-color); + @include message-box($box-note-color); } dl.warning,dl.attention { - .message-box(@box-warning-color); + @include message-box($box-warning-color); } dl.deprecated,dl.bug { - .message-box(@box-bug-color); + @include message-box($box-bug-color); } dl.todo,dl.test { - .message-box(@box-todo-color); + @include message-box($box-todo-color); } dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test { @@ -404,7 +404,7 @@ div.fragment,pre.fragment { } .lineno a,.lineno a:visited,.line,pre.fragment { - color:@default-text-color; + color:$default-text-color; } span.preprocessor,span.comment { @@ -416,7 +416,7 @@ a.code,a.code:visited { } span.keyword,span.keywordtype,span.keywordflow { - color:darken(@default-text-color, 5%); + color:darken($default-text-color, 5%); font-weight:bold; } From 58df92acad5ec924274b3c33d277279475a6a645 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 18 Sep 2020 14:24:08 +0200 Subject: [PATCH 03/63] Use consistent indentation for Doxygen custom stylesheet Most of this file is indented with tabs but parts are indented with spaces. Closes #1770. --- docs/extra.scss | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/extra.scss b/docs/extra.scss index 32993429..6c5f3c25 100644 --- a/docs/extra.scss +++ b/docs/extra.scss @@ -77,8 +77,8 @@ $box-todo-color: hsl(200,80%,85%); } .sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover { - background:none; - text-shadow:none; + background:none; + text-shadow:none; } .sm-dox a span.sub-arrow { @@ -94,13 +94,13 @@ $box-todo-color: hsl(200,80%,85%); } .sm-dox ul a:hover { - background:$header-footer-link-color; - text-shadow:none; + background:$header-footer-link-color; + text-shadow:none; } .sm-dox ul.sm-nowrap a { color:$default-text-color; - text-shadow:none; + text-shadow:none; } #main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code { @@ -141,20 +141,20 @@ h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em { } h1 { - padding-top:0.5em; - font-size:180%; + padding-top:0.5em; + font-size:180%; } h2 { - padding-top:0.5em; - margin-bottom:0; - font-size:140%; + padding-top:0.5em; + margin-bottom:0; + font-size:140%; } h3 { - padding-top:0.5em; - margin-bottom:0; - font-size:110%; + padding-top:0.5em; + margin-bottom:0; + font-size:110%; } .glfwheader { @@ -232,12 +232,12 @@ address.footer { } .memtitle { - display:none; + display:none; } .memproto,.memname { - font-weight:bold; - text-shadow:none; + font-weight:bold; + text-shadow:none; } #main-menu { From 73ef5f0abb3316bfb34aea0b3f754819705d17d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 22 Sep 2020 19:12:47 +0200 Subject: [PATCH 04/63] Update CODEOWNERS for move to SCSS --- docs/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS index ec174185..018808ba 100644 --- a/docs/CODEOWNERS +++ b/docs/CODEOWNERS @@ -4,7 +4,7 @@ src/wl_* @linkmauve docs/*.css @glfw/webdev -docs/*.less @glfw/webdev +docs/*.scss @glfw/webdev docs/*.html @glfw/webdev docs/*.xml @glfw/webdev From 539535a367f78a393b48a910956ba9a4ee04e364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 23 Sep 2020 20:06:18 +0200 Subject: [PATCH 05/63] Specify maximum version of CMake known to work Related to #1753. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3a884b7..f7e4f409 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.1...3.17) project(GLFW VERSION 3.4.0 LANGUAGES C) From 1353f37a5172d05d89645d8f3e9414fbdd4fc3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 23 Sep 2020 20:07:34 +0200 Subject: [PATCH 06/63] Make unsupported versions of CMake fail early --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7e4f409..42bfa180 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1...3.17) +cmake_minimum_required(VERSION 3.1...3.17 FATAL_ERROR) project(GLFW VERSION 3.4.0 LANGUAGES C) From 2747e47393cbca2d09db56223e735bd94b21e2eb Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 28 Sep 2020 22:23:02 -0700 Subject: [PATCH 07/63] Wayland: Remove extra-cmake-modules dependency Fixes #1774. --- .gitignore | 4 --- CMakeLists.txt | 16 ++++++------ src/CMakeLists.txt | 62 ++++++++++++++++++++++++++++------------------ 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 266019f3..b34fc452 100644 --- a/.gitignore +++ b/.gitignore @@ -52,10 +52,6 @@ src/glfw_config.h src/glfw3.pc src/glfw3Config.cmake src/glfw3ConfigVersion.cmake -src/wayland-pointer-constraints-unstable-v1-client-protocol.h -src/wayland-pointer-constraints-unstable-v1-protocol.c -src/wayland-relative-pointer-unstable-v1-client-protocol.h -src/wayland-relative-pointer-unstable-v1-protocol.c # Compiled binaries src/libglfw.so diff --git a/CMakeLists.txt b/CMakeLists.txt index 42bfa180..39482752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,20 +191,18 @@ endif() # Use Wayland for window creation #-------------------------------------------------------------------- if (_GLFW_WAYLAND) - find_package(ECM REQUIRED NO_MODULE) - list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") - find_package(Wayland REQUIRED Client Cursor Egl) - find_package(WaylandScanner REQUIRED) - find_package(WaylandProtocols 1.15 REQUIRED) + include(FindPkgConfig) + pkg_check_modules(Wayland REQUIRED + wayland-client>=0.2.7 + wayland-cursor>=0.2.7 + wayland-egl>=0.2.7 + xkbcommon) list(APPEND glfw_PKG_DEPS "wayland-client") list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}") - list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}") - - find_package(XKBCommon REQUIRED) - list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}") + list(APPEND glfw_LIBRARIES "${Wayland_LINK_LIBRARIES}") include(CheckIncludeFiles) include(CheckFunctionExists) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f2bdd88..e834506c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,30 +45,44 @@ if (_GLFW_X11 OR _GLFW_WAYLAND) endif() if (_GLFW_WAYLAND) - ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml" - BASENAME xdg-shell) - ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" - BASENAME xdg-decoration) - ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml" - BASENAME viewporter) - ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" - BASENAME relative-pointer-unstable-v1) - ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" - BASENAME pointer-constraints-unstable-v1) - ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES - PROTOCOL - "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" - BASENAME idle-inhibit-unstable-v1) + find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) + pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) + pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) + + macro(wayland_generate protocol_file output_file) + add_custom_command(OUTPUT ${output_file}.h + COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header + < ${protocol_file} > ${output_file}.h + DEPENDS ${protocol_file}) + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.h) + + add_custom_command(OUTPUT ${output_file}.c + COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code + < ${protocol_file} > ${output_file}.c + DEPENDS ${protocol_file}) + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.c) + endmacro() + + set(GLFW_WAYLAND_PROTOCOL_SOURCES) + wayland_generate( + ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml + ${CMAKE_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) + wayland_generate( + ${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml + ${CMAKE_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) + wayland_generate( + ${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml + ${CMAKE_BINARY_DIR}/src/wayland-viewporter-client-protocol) + wayland_generate( + ${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml + ${CMAKE_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) + wayland_generate( + ${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml + ${CMAKE_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) + wayland_generate( + ${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml + ${CMAKE_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) + target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES}) endif() From 2e6fb7fe226d574eae788648c0070753ad2b00e1 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 30 Sep 2020 17:00:12 +0200 Subject: [PATCH 08/63] Wayland: Remove extra trailing whitespace --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e834506c..b47b2354 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,7 +56,7 @@ if (_GLFW_WAYLAND) DEPENDS ${protocol_file}) list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.h) - add_custom_command(OUTPUT ${output_file}.c + add_custom_command(OUTPUT ${output_file}.c COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code < ${protocol_file} > ${output_file}.c DEPENDS ${protocol_file}) From 8aaf0728422e14280e0a3a2cfa482984d7576632 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 30 Sep 2020 17:00:41 +0200 Subject: [PATCH 09/63] Wayland: Remove extra-cmake-modules from CI --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5978469..ff675629 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,6 @@ matrix: addons: apt: packages: - - extra-cmake-modules - wayland-protocols - libwayland-dev - libxkbcommon-dev @@ -56,7 +55,6 @@ matrix: addons: apt: packages: - - extra-cmake-modules - wayland-protocols - libwayland-dev - libxkbcommon-dev From 40d150c39900921e94f16f53ba38b4b48689f80e Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 30 Sep 2020 17:04:20 +0200 Subject: [PATCH 10/63] Docs: Remove mentions of extra-cmake-modules --- README.md | 3 --- docs/compile.dox | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 0fde759f..cafcca46 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,6 @@ in the documentation for more information. GLFW itself needs only CMake 3.1 or later and the headers and libraries for your OS and window system. -The (experimental) Wayland backend also depends on the `extra-cmake-modules` -package, which is used to generate Wayland protocol headers. - The examples and test programs depend on a number of tiny libraries. These are located in the `deps/` directory. diff --git a/docs/compile.dox b/docs/compile.dox index 271cee4d..5a4c6d88 100644 --- a/docs/compile.dox +++ b/docs/compile.dox @@ -103,8 +103,7 @@ To compile GLFW for Wayland, you need to have the Wayland packages installed, as well as the basic development tools like GCC and make. For example, on Ubuntu and other distributions based on Debian GNU/Linux, you need to install the `libwayland-dev` package, which contains all Wayland headers and pulls in -wayland-scanner, as well as the `wayland-protocols` and `extra-cmake-modules` -packages. +wayland-scanner, as well as the `wayland-protocols` package. Once you have installed the necessary packages, move on to @ref compile_generate. From 0b2660f39fc7111a3ef2723b03f5111afbe75bb9 Mon Sep 17 00:00:00 2001 From: Nicolas Caramelli Date: Sat, 3 Oct 2020 22:22:32 +0200 Subject: [PATCH 11/63] Wayland: Remove FindWaylandProtocols.cmake and FindXKBCommon.cmake (not used anymore) --- CMake/modules/FindWaylandProtocols.cmake | 26 ------------------ CMake/modules/FindXKBCommon.cmake | 34 ------------------------ 2 files changed, 60 deletions(-) delete mode 100644 CMake/modules/FindWaylandProtocols.cmake delete mode 100644 CMake/modules/FindXKBCommon.cmake diff --git a/CMake/modules/FindWaylandProtocols.cmake b/CMake/modules/FindWaylandProtocols.cmake deleted file mode 100644 index 8eb83f27..00000000 --- a/CMake/modules/FindWaylandProtocols.cmake +++ /dev/null @@ -1,26 +0,0 @@ -find_package(PkgConfig) - -pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION}) - -execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols - OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR - RESULT_VARIABLE _pkgconfig_failed) -if (_pkgconfig_failed) - message(FATAL_ERROR "Missing wayland-protocols pkgdatadir") -endif() - -string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") - -find_package_handle_standard_args(WaylandProtocols - FOUND_VAR - WaylandProtocols_FOUND - REQUIRED_VARS - WaylandProtocols_PKGDATADIR - VERSION_VAR - WaylandProtocols_VERSION - HANDLE_COMPONENTS -) - -set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) -set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) -set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) diff --git a/CMake/modules/FindXKBCommon.cmake b/CMake/modules/FindXKBCommon.cmake deleted file mode 100644 index 0f571eea..00000000 --- a/CMake/modules/FindXKBCommon.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# - Try to find XKBCommon -# Once done, this will define -# -# XKBCOMMON_FOUND - System has XKBCommon -# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories -# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon -# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon - -find_package(PkgConfig) -pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) -set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) - -find_path(XKBCOMMON_INCLUDE_DIR - NAMES xkbcommon/xkbcommon.h - HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} -) - -find_library(XKBCOMMON_LIBRARY - NAMES xkbcommon - HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} -) - -set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) -set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) -set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(XKBCommon DEFAULT_MSG - XKBCOMMON_LIBRARY - XKBCOMMON_INCLUDE_DIR -) - -mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) - From 166611cef5967313e6a3d50849e57ddbcdc33f26 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Fri, 4 Sep 2020 16:59:08 +0100 Subject: [PATCH 12/63] Win32: Update all monitor handles on config change Closes #1761. --- src/win32_monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/win32_monitor.c b/src/win32_monitor.c index 5f91c579..b4c53e4c 100644 --- a/src/win32_monitor.c +++ b/src/win32_monitor.c @@ -185,6 +185,8 @@ void _glfwPollMonitorsWin32(void) display.DeviceName) == 0) { disconnected[i] = NULL; + // handle may have changed, update + EnumDisplayMonitors(NULL, NULL, monitorCallback, (LPARAM) _glfw.monitors[i]); break; } } From 60e7364b304e4ead20856db303c03ee7359a0097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 23 Sep 2020 23:34:42 +0200 Subject: [PATCH 13/63] Update changelog Related to #1761. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cafcca46..ed94b27a 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,8 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Some synthetic key events were reported as `GLFW_KEY_UNKNOWN` (#1623) - [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16 + - [Win32] Bugfix: Monitor functions could return invalid values after + configuration change (#1761) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) From 53b1396a09be83254e90dc4c815052a1a57ab144 Mon Sep 17 00:00:00 2001 From: Vladimir Perminov Date: Tue, 29 Sep 2020 20:03:42 +0300 Subject: [PATCH 14/63] Win32: Fix value for _WIN32_WINNT_WINBLUE An incorrect value for _WIN32_WINNT_WINBLUE caused GLFW to think Windows 8 was 8.1 or greater. This led to a crash when attempting to call SetProcessDpiAwareness. Closes #1775. --- src/win32_platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32_platform.h b/src/win32_platform.h index 260a77ff..4f520514 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -102,7 +102,7 @@ #define DISPLAY_DEVICE_ACTIVE 0x00000001 #endif #ifndef _WIN32_WINNT_WINBLUE - #define _WIN32_WINNT_WINBLUE 0x0602 + #define _WIN32_WINNT_WINBLUE 0x0603 #endif #ifndef _WIN32_WINNT_WIN8 #define _WIN32_WINNT_WIN8 0x0602 From 48aa567d0c825cf2073f6a06d72f1aa593da7ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 29 Sep 2020 20:16:59 +0200 Subject: [PATCH 15/63] Update changelog and add credit Related to #1775. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ed94b27a..8383d594 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16 - [Win32] Bugfix: Monitor functions could return invalid values after configuration change (#1761) + - [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) @@ -360,6 +361,7 @@ skills. - Braden Pellett - Christopher Pelloux - Arturo J. Pérez + - Vladimir Perminov - Anthony Pesch - Orson Peters - Emmanuel Gil Peyrot From 8d47dc5894623bc7a1447236fd9ba62ecd70bc97 Mon Sep 17 00:00:00 2001 From: Nicolas Caramelli Date: Sun, 4 Oct 2020 21:33:08 +0200 Subject: [PATCH 16/63] Update test SPIR-V shader code Closes #1781. --- tests/triangle-vulkan.c | 188 ++++++++++------------------------------ 1 file changed, 46 insertions(+), 142 deletions(-) diff --git a/tests/triangle-vulkan.c b/tests/triangle-vulkan.c index 33442968..7f783694 100644 --- a/tests/triangle-vulkan.c +++ b/tests/triangle-vulkan.c @@ -70,150 +70,54 @@ static GLADapiproc glad_vulkan_callback(const char* name, void* user) return glfwGetInstanceProcAddress((VkInstance) user, name); } -static const char fragShaderCode[] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, - 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, - 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, 0x65, 0x70, 0x61, 0x72, - 0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, - 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, - 0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00, 0x05, 0x00, 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x75, 0x46, 0x72, 0x61, - 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x11, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x0b, 0x00, 0x00, 0x00, - 0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, - 0x0e, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x0f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, - 0x0e, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, - 0x38, 0x00, 0x01, 0x00 +static const uint32_t fragShaderCode[] = { + 0x07230203,0x00010000,0x00080007,0x00000014,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, + 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00030010, + 0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252, + 0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47, + 0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005, + 0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x61724675,0x6c6f4367,0x0000726f, + 0x00030005,0x0000000d,0x00786574,0x00050005,0x00000011,0x63786574,0x64726f6f,0x00000000, + 0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000, + 0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,0x0000001e,0x00000000, + 0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, + 0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007, + 0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001, + 0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a, + 0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000, + 0x00040017,0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f, + 0x0004003b,0x00000010,0x00000011,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000, + 0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d, + 0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,0x00000013,0x0000000e,0x00000012, + 0x0003003e,0x00000009,0x00000013,0x000100fd,0x00010038 }; -static const char vertShaderCode[] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, - 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, - 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, - 0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, - 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64, - 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, - 0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, - 0x68, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, - 0x61, 0x67, 0x65, 0x5f, 0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00, - 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x67, 0x6c, 0x5f, 0x50, 0x65, 0x72, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x00, 0x06, 0x00, 0x07, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x53, 0x69, 0x7a, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, - 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x43, - 0x6c, 0x69, 0x70, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x00, - 0x05, 0x00, 0x03, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x03, 0x00, 0x17, 0x00, 0x00, 0x00, 0x70, 0x6f, 0x73, 0x00, - 0x05, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x56, - 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x00, 0x05, 0x00, 0x06, 0x00, - 0x1d, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x49, 0x44, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, - 0x1c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x15, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x12, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x3b, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x19, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00, - 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, - 0x1b, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, - 0x13, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0x1a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, - 0x38, 0x00, 0x01, 0x00 +static const uint32_t vertShaderCode[] = { + 0x07230203,0x00010000,0x00080007,0x00000018,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, + 0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00000010, + 0x00000014,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065, + 0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,0x735f4252, + 0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,0x00000004, + 0x6e69616d,0x00000000,0x00050005,0x00000009,0x63786574,0x64726f6f,0x00000000,0x00040005, + 0x0000000b,0x72747461,0x00000000,0x00060005,0x0000000e,0x505f6c67,0x65567265,0x78657472, + 0x00000000,0x00060006,0x0000000e,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005, + 0x00000010,0x00000000,0x00030005,0x00000014,0x00736f70,0x00040047,0x00000009,0x0000001e, + 0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000001,0x00050048,0x0000000e,0x00000000, + 0x0000000b,0x00000000,0x00030047,0x0000000e,0x00000002,0x00040047,0x00000014,0x0000001e, + 0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006, + 0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000003, + 0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040020,0x0000000a,0x00000001, + 0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x00040017,0x0000000d,0x00000006, + 0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000003,0x0000000e, + 0x0004003b,0x0000000f,0x00000010,0x00000003,0x00040015,0x00000011,0x00000020,0x00000001, + 0x0004002b,0x00000011,0x00000012,0x00000000,0x00040020,0x00000013,0x00000001,0x0000000d, + 0x0004003b,0x00000013,0x00000014,0x00000001,0x00040020,0x00000016,0x00000003,0x0000000d, + 0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d, + 0x00000007,0x0000000c,0x0000000b,0x0003003e,0x00000009,0x0000000c,0x0004003d,0x0000000d, + 0x00000015,0x00000014,0x00050041,0x00000016,0x00000017,0x00000010,0x00000012,0x0003003e, + 0x00000017,0x00000015,0x000100fd,0x00010038 }; struct texture_object { From a506a8dc73dca2d3e07068d02cd008cdf958a914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 5 Oct 2020 23:23:57 +0200 Subject: [PATCH 17/63] Add credit Related to #1779 and #1781. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8383d594..7488e6d0 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,7 @@ skills. - Rok Breulj - Kai Burjack - Martin Capitanio + - Nicolas Caramelli - David Carlier - Arturo Castro - Chi-kwan Chan From 0ef149c8f2451fbc8e866834675a075cfc295b6c Mon Sep 17 00:00:00 2001 From: Nicolas Caramelli Date: Wed, 14 Oct 2020 10:25:46 +0200 Subject: [PATCH 18/63] Wayland: Assume 96 DPI if physical size is <= 0 --- src/wl_init.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wl_init.c b/src/wl_init.c index 21a808aa..d3e777d4 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -1038,6 +1038,8 @@ int _glfwPlatformInit(void) char *cursorSizeEnd; long cursorSizeLong; int cursorSize; + int i; + _GLFWmonitor* monitor; _glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0"); if (!_glfw.wl.cursor.handle) @@ -1146,6 +1148,17 @@ int _glfwPlatformInit(void) // Sync so we got all initial output events wl_display_roundtrip(_glfw.wl.display); + for (i = 0; i < _glfw.monitorCount; ++i) + { + monitor = _glfw.monitors[i]; + if (monitor->widthMM <= 0 || monitor->heightMM <= 0) + { + // If Wayland does not provide a physical size, assume the default 96 DPI + monitor->widthMM = (int) (monitor->modes[monitor->wl.currentMode].width * 25.4f / 96.f); + monitor->heightMM = (int) (monitor->modes[monitor->wl.currentMode].height * 25.4f / 96.f); + } + } + _glfwInitTimerPOSIX(); _glfw.wl.timerfd = -1; From c940695eb03723fa6e4b174db524bcaa4f55bbee Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 14 Oct 2020 17:53:01 +0100 Subject: [PATCH 19/63] Fix macOS Print Screen Many years ago this value was changed from F13 to Print Screen with 1ae9ce1e0a00bf6f8b7e719bf1ec6e73f111afcf. However, this was later reverted to F13 with 5759d0fdf272351b35f666718a6e2a665db827e8. This changes it back to Print Screen for consistency with other platforms. Closes #1786. --- src/cocoa_init.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 7cad8b8e..edd174be 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -251,7 +251,7 @@ static void createKeyTables(void) _glfw.ns.keycodes[0x6D] = GLFW_KEY_F10; _glfw.ns.keycodes[0x67] = GLFW_KEY_F11; _glfw.ns.keycodes[0x6F] = GLFW_KEY_F12; - _glfw.ns.keycodes[0x69] = GLFW_KEY_F13; + _glfw.ns.keycodes[0x69] = GLFW_KEY_PRINT_SCREEN; _glfw.ns.keycodes[0x6B] = GLFW_KEY_F14; _glfw.ns.keycodes[0x71] = GLFW_KEY_F15; _glfw.ns.keycodes[0x6A] = GLFW_KEY_F16; From 35f3508ecd5979ea456604b0ffc3aaeb85575587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 20 Oct 2020 20:03:58 +0200 Subject: [PATCH 20/63] Update changelog and add credit Related to #1786. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7488e6d0..a87b7f0b 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,8 @@ information on what to include when reporting a bug. - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) - [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169) + - [Cocoa] Changed F13 key to report Print Screen for cross-platform consistency + (#1786) - [Cocoa] Removed dependency on the CoreVideo framework - [Cocoa] Bugfix: `glfwSetWindowSize` used a bottom-left anchor point (#1553) - [Cocoa] Bugfix: Window remained on screen after destruction until event poll @@ -428,6 +430,7 @@ skills. - Waris - Jay Weisskopf - Frank Wille + - Andy Williams - Tatsuya Yatagawa - Ryogo Yoshimura - Lukas Zanner From 9b140d08d72b52915ddf1974342af06c6b93e06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Oct 2020 21:40:16 +0200 Subject: [PATCH 21/63] Remove ignored Clang compiler flag Clang ignores this when C99 is enabled, while GCC does not. Removing the checks for Clang to hopefully avoid a false sense of security. --- src/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b47b2354..e2b86412 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -121,18 +121,20 @@ if (APPLE) LANGUAGE C) endif() -if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - - # Make GCC and Clang warn about declarations that VS 2010 and 2012 won't - # accept for all source files that VS will build +# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all +# source files that VS will build (Clang ignores this because we set -std=c99) +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") set_source_files_properties(context.c init.c input.c monitor.c vulkan.c window.c win32_init.c win32_joystick.c win32_monitor.c win32_time.c win32_thread.c win32_window.c wgl_context.c egl_context.c osmesa_context.c PROPERTIES COMPILE_FLAGS -Wdeclaration-after-statement) +endif() + +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") # Enable a reasonable set of warnings (no, -Wextra is not reasonable) target_compile_options(glfw PRIVATE "-Wall") From 6b78419c9ae8d504e3b44adab51645d89c23108c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Oct 2020 22:50:54 +0200 Subject: [PATCH 22/63] Win32: Enable /W3 on VS for library sources /W3 is the default for new VS projects and the library builds cleanly with it on VS 2010-2019 so let's try to keep it that way. --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2b86412..71653557 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -132,12 +132,14 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") COMPILE_FLAGS -Wdeclaration-after-statement) endif() +# Enable a reasonable set of warnings if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - # Enable a reasonable set of warnings (no, -Wextra is not reasonable) target_compile_options(glfw PRIVATE "-Wall") +elseif (MSVC) + target_compile_options(glfw PRIVATE "/W3") endif() if (WIN32) From ac627706ef93362caf08bd3bf249656efd9151e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Oct 2020 22:51:58 +0200 Subject: [PATCH 23/63] Win32: Fix clang-cl interpreting -Wall as /Wall Unlike -Wall, VS /Wall really means all warnings. Closes #1780. --- README.md | 1 + src/CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a87b7f0b..ab16fb1c 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,7 @@ skills. - Eloi Marín Gratacós - Stefan Gustavson - Jonathan Hale + - hdf89shfdfs - Sylvain Hellegouarch - Matthew Henry - heromyth diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 71653557..68b8e9a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,7 +137,12 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - target_compile_options(glfw PRIVATE "-Wall") + if ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") + # Tell Clang-CL that this is a Clang flag + target_compile_options(glfw PRIVATE "/clang:-Wall") + else() + target_compile_options(glfw PRIVATE "-Wall") + endif() elseif (MSVC) target_compile_options(glfw PRIVATE "/W3") endif() From 0bccc3852b903e690e77e66d2486fb33166e112d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 7 Oct 2020 23:35:17 +0200 Subject: [PATCH 24/63] Win32: Filter out duplicate size events This mirrors the filtering done on X11 and Cocoa. Possibly this should be done by shared code instead. Fixes #1610. --- README.md | 2 ++ src/win32_platform.h | 3 +++ src/win32_window.c | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab16fb1c..5d18e33f 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Monitor functions could return invalid values after configuration change (#1761) - [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775) + - [Win32] Bugfix: Duplicate size events were not filtered (#1610) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) @@ -326,6 +327,7 @@ skills. - Shane Liesegang - Anders Lindqvist - Leon Linhart + - Marco Lizza - Eyal Lotem - Aaron Loucks - Luflosi diff --git a/src/win32_platform.h b/src/win32_platform.h index 4f520514..6c81d4b5 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -314,6 +314,9 @@ typedef struct _GLFWwindowWin32 GLFWbool scaleToMonitor; GLFWbool keymenu; + // Cached size used to filter out duplicate events + int width, height; + // The last received cursor position, regardless of source int lastCursorPosX, lastCursorPosY; // The last recevied high surrogate when decoding pairs of UTF-16 messages diff --git a/src/win32_window.c b/src/win32_window.c index 8cb50500..ce06d37c 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -961,6 +961,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_SIZE: { + const int width = LOWORD(lParam); + const int height = HIWORD(lParam); const GLFWbool iconified = wParam == SIZE_MINIMIZED; const GLFWbool maximized = wParam == SIZE_MAXIMIZED || (window->win32.maximized && @@ -975,8 +977,14 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, if (window->win32.maximized != maximized) _glfwInputWindowMaximize(window, maximized); - _glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam)); - _glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam)); + if (width != window->win32.width || height != window->win32.height) + { + window->win32.width = width; + window->win32.height = height; + + _glfwInputFramebufferSize(window, width, height); + _glfwInputWindowSize(window, width, height); + } if (window->monitor && window->win32.iconified != iconified) { @@ -1315,6 +1323,8 @@ static int createNativeWindow(_GLFWwindow* window, window->win32.transparent = GLFW_TRUE; } + _glfwPlatformGetWindowSize(window, &window->win32.width, &window->win32.height); + return GLFW_TRUE; } From af8f9713dd807968d0cbcca77fb63a210aaa8f65 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Thu, 8 Oct 2020 14:58:06 -0700 Subject: [PATCH 25/63] Wayland: Fix CMake binary dir when built as subdir Regression introduced by 2747e47393cbca2d09db56223e735bd94b21e2eb. Related to #1782. --- src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 68b8e9a3..f583d571 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,22 +66,22 @@ if (_GLFW_WAYLAND) set(GLFW_WAYLAND_PROTOCOL_SOURCES) wayland_generate( ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml - ${CMAKE_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) + ${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) wayland_generate( ${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml - ${CMAKE_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) + ${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) wayland_generate( ${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml - ${CMAKE_BINARY_DIR}/src/wayland-viewporter-client-protocol) + ${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol) wayland_generate( ${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml - ${CMAKE_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) + ${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) wayland_generate( ${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - ${CMAKE_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) + ${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) wayland_generate( ${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml - ${CMAKE_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) + ${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES}) endif() From a6f8cc9d4458272d890f63b1873ed42f8ada6822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 12 Oct 2020 17:34:46 +0200 Subject: [PATCH 26/63] Fix unquoted paths with variable references Whitespace is a field separator in CMake. --- src/CMakeLists.txt | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f583d571..8a11ef96 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,38 +50,38 @@ if (_GLFW_WAYLAND) pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) macro(wayland_generate protocol_file output_file) - add_custom_command(OUTPUT ${output_file}.h - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header - < ${protocol_file} > ${output_file}.h - DEPENDS ${protocol_file}) - list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.h) + add_custom_command(OUTPUT "${output_file}.h" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header + < "${protocol_file}" > "${output_file}.h" + DEPENDS "${protocol_file}") + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.h)" - add_custom_command(OUTPUT ${output_file}.c - COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code - < ${protocol_file} > ${output_file}.c - DEPENDS ${protocol_file}) - list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.c) + add_custom_command(OUTPUT "${output_file}.c" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code + < "${protocol_file}" > "${output_file}.c" + DEPENDS "${protocol_file}") + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.c") endmacro() set(GLFW_WAYLAND_PROTOCOL_SOURCES) wayland_generate( - ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml - ${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) + "${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml" + "${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol") wayland_generate( - ${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml - ${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) + "${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol") wayland_generate( - ${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml - ${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol) + "${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml" + "${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol") wayland_generate( - ${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml - ${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) + "${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol") wayland_generate( - ${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - ${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) + "${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol") wayland_generate( - ${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml - ${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) + "${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" + "${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol") target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES}) endif() From d5f32dfb3b64ad9e0271363e4421d95c5b167054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 12 Oct 2020 18:20:53 +0200 Subject: [PATCH 27/63] Wayland: Ensure paths are passed on in quoted form --- src/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8a11ef96..a12b96c4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,13 +53,16 @@ if (_GLFW_WAYLAND) add_custom_command(OUTPUT "${output_file}.h" COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header < "${protocol_file}" > "${output_file}.h" - DEPENDS "${protocol_file}") + DEPENDS "${protocol_file}" + VERBATIM) list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.h)" add_custom_command(OUTPUT "${output_file}.c" COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code < "${protocol_file}" > "${output_file}.c" - DEPENDS "${protocol_file}") + DEPENDS "${protocol_file}" + VERBATIM) + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.c") endmacro() From a62a6c5019d1124603b55cc335ab8071689191c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 12 Oct 2020 18:26:09 +0200 Subject: [PATCH 28/63] Wayland: Scanner tool has input and output args --- src/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a12b96c4..61e13146 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,15 +51,13 @@ if (_GLFW_WAYLAND) macro(wayland_generate protocol_file output_file) add_custom_command(OUTPUT "${output_file}.h" - COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header - < "${protocol_file}" > "${output_file}.h" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h" DEPENDS "${protocol_file}" VERBATIM) list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.h)" add_custom_command(OUTPUT "${output_file}.c" - COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code - < "${protocol_file}" > "${output_file}.c" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}.c" DEPENDS "${protocol_file}" VERBATIM) From 420b165bffb63aec762d69db0f6372a3f2375762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 12 Oct 2020 18:32:50 +0200 Subject: [PATCH 29/63] Wayland: Fix indentation --- src/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 61e13146..7c095e67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,18 +50,18 @@ if (_GLFW_WAYLAND) pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) macro(wayland_generate protocol_file output_file) - add_custom_command(OUTPUT "${output_file}.h" - COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h" - DEPENDS "${protocol_file}" - VERBATIM) - list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.h)" + add_custom_command(OUTPUT "${output_file}.h" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h" + DEPENDS "${protocol_file}" + VERBATIM) + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.h)" - add_custom_command(OUTPUT "${output_file}.c" - COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}.c" - DEPENDS "${protocol_file}" - VERBATIM) + add_custom_command(OUTPUT "${output_file}.c" + COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}.c" + DEPENDS "${protocol_file}" + VERBATIM) - list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.c") + list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.c") endmacro() set(GLFW_WAYLAND_PROTOCOL_SOURCES) From 2f76f70c766390019241954a6645219422113daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 12 Oct 2020 18:34:09 +0200 Subject: [PATCH 30/63] Wayland: Simplify adding of protocol sources --- src/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7c095e67..14450938 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,17 +54,15 @@ if (_GLFW_WAYLAND) COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h" DEPENDS "${protocol_file}" VERBATIM) - list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.h)" add_custom_command(OUTPUT "${output_file}.c" COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}.c" DEPENDS "${protocol_file}" VERBATIM) - list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES "${output_file}.c") + target_sources(glfw PRIVATE "${output_file}.h" "${output_file}.c") endmacro() - set(GLFW_WAYLAND_PROTOCOL_SOURCES) wayland_generate( "${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml" "${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol") @@ -83,8 +81,6 @@ if (_GLFW_WAYLAND) wayland_generate( "${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" "${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol") - - target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES}) endif() if (WIN32 AND BUILD_SHARED_LIBS) From 5c928ff4527240b5b24e6c37229e7b35008bcf46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 12 Oct 2020 18:56:25 +0200 Subject: [PATCH 31/63] Add credit Related to #1774 and #1782. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5d18e33f..43ab7c3c 100644 --- a/README.md +++ b/README.md @@ -434,6 +434,7 @@ skills. - Jay Weisskopf - Frank Wille - Andy Williams + - Joel Winarske - Tatsuya Yatagawa - Ryogo Yoshimura - Lukas Zanner From 3327050ca66ad34426a82c217c2d60ced61526b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 18 Oct 2020 19:34:23 +0200 Subject: [PATCH 32/63] Cocoa: Fix ObjC being built as C with CMake 3.19 CMake 3.19 adds -xc when the LANGUAGE file property is C, breaking our workaround for CMake 3.15 and earlier not understanding the .m suffix. Fixes #1787. --- README.md | 2 ++ src/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 43ab7c3c..198063c3 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ information on what to include when reporting a bug. (#1635) - [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays could leak memory + - [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) @@ -322,6 +323,7 @@ skills. - Konstantin Käfer - Eric Larson - Francis Lecavalier + - Jong Won Lee - Robin Leffmann - Glenn Lewis - Shane Liesegang diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 14450938..3a45ea50 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -112,7 +112,7 @@ target_include_directories(glfw PRIVATE target_link_libraries(glfw PRIVATE Threads::Threads ${glfw_LIBRARIES}) # Workaround for CMake not knowing about .m files before version 3.16 -if (APPLE) +if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE) set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m cocoa_window.m nsgl_context.m PROPERTIES LANGUAGE C) From 0dc1005c853e9bdd00448ca1a3405858790a9fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20K=C3=B6nig?= Date: Wed, 28 Oct 2020 19:23:28 +0100 Subject: [PATCH 33/63] Wayland: Fix destroying CSDs in the correct order On Wayland we implement Client-Side Decorations if the compositors do not implement SSDs. In that case, the destructors of the surfaces were called in the wrong order, leading to a dereference of an already freed object. We need to first destroy the subsurface before destroying the parent surface. Related PR on kitty: https://github.com/kovidgoyal/kitty/pull/3066 Related issue on kitty: https://github.com/kovidgoyal/kitty/issues/3051 Closes #1798. --- README.md | 2 ++ src/wl_window.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 198063c3..c7a5caa9 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault - [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms (#1463) + - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer @@ -445,6 +446,7 @@ skills. - Santi Zupancic - Jonas Ådahl - Lasse Öörni + - Leonard König - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement diff --git a/src/wl_window.c b/src/wl_window.c index 7b315d70..8899a44b 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -246,10 +246,10 @@ static void createDecorations(_GLFWwindow* window) static void destroyDecoration(_GLFWdecorationWayland* decoration) { - if (decoration->surface) - wl_surface_destroy(decoration->surface); if (decoration->subsurface) wl_subsurface_destroy(decoration->subsurface); + if (decoration->surface) + wl_surface_destroy(decoration->surface); if (decoration->viewport) wp_viewport_destroy(decoration->viewport); decoration->surface = NULL; From 7e8da57094281c73a0be5669a4b79686b4917f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 19 Nov 2020 02:49:14 +0100 Subject: [PATCH 34/63] Add missing changelog issue number --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c7a5caa9..b4d798b9 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms (#1463) - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder + (#1798) - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer From 08e5a1706318e4fd32366a88d0778a9f545175af Mon Sep 17 00:00:00 2001 From: Luflosi Date: Thu, 23 Jul 2020 18:22:23 +0200 Subject: [PATCH 35/63] Use switch statement instead of if-else-chain for cursor shapes Closes #1739. --- src/cocoa_window.m | 66 +++++++++++++++++++------------ src/win32_window.c | 57 ++++++++++++++++----------- src/wl_window.c | 90 ++++++++++++++++++++++++------------------ src/x11_window.c | 97 ++++++++++++++++++++++++++++------------------ 4 files changed, 187 insertions(+), 123 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 81b22e2f..b618dccc 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1635,14 +1635,21 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) SEL cursorSelector = NULL; // HACK: Try to use a private message - if (shape == GLFW_RESIZE_EW_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeEastWestCursor"); - else if (shape == GLFW_RESIZE_NS_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeNorthSouthCursor"); - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeNorthWestSouthEastCursor"); - else if (shape == GLFW_RESIZE_NESW_CURSOR) - cursorSelector = NSSelectorFromString(@"_windowResizeNorthEastSouthWestCursor"); + switch (shape) + { + case GLFW_RESIZE_EW_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeEastWestCursor"); + break; + case GLFW_RESIZE_NS_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeNorthSouthCursor"); + break; + case GLFW_RESIZE_NWSE_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeNorthWestSouthEastCursor"); + break; + case GLFW_RESIZE_NESW_CURSOR: + cursorSelector = NSSelectorFromString(@"_windowResizeNorthEastSouthWestCursor"); + break; + } if (cursorSelector && [NSCursor respondsToSelector:cursorSelector]) { @@ -1653,22 +1660,33 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) if (!cursor->ns.object) { - if (shape == GLFW_ARROW_CURSOR) - cursor->ns.object = [NSCursor arrowCursor]; - else if (shape == GLFW_IBEAM_CURSOR) - cursor->ns.object = [NSCursor IBeamCursor]; - else if (shape == GLFW_CROSSHAIR_CURSOR) - cursor->ns.object = [NSCursor crosshairCursor]; - else if (shape == GLFW_POINTING_HAND_CURSOR) - cursor->ns.object = [NSCursor pointingHandCursor]; - else if (shape == GLFW_RESIZE_EW_CURSOR) - cursor->ns.object = [NSCursor resizeLeftRightCursor]; - else if (shape == GLFW_RESIZE_NS_CURSOR) - cursor->ns.object = [NSCursor resizeUpDownCursor]; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - cursor->ns.object = [NSCursor closedHandCursor]; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - cursor->ns.object = [NSCursor operationNotAllowedCursor]; + switch (shape) + { + case GLFW_ARROW_CURSOR: + cursor->ns.object = [NSCursor arrowCursor]; + break; + case GLFW_IBEAM_CURSOR: + cursor->ns.object = [NSCursor IBeamCursor]; + break; + case GLFW_CROSSHAIR_CURSOR: + cursor->ns.object = [NSCursor crosshairCursor]; + break; + case GLFW_POINTING_HAND_CURSOR: + cursor->ns.object = [NSCursor pointingHandCursor]; + break; + case GLFW_RESIZE_EW_CURSOR: + cursor->ns.object = [NSCursor resizeLeftRightCursor]; + break; + case GLFW_RESIZE_NS_CURSOR: + cursor->ns.object = [NSCursor resizeUpDownCursor]; + break; + case GLFW_RESIZE_ALL_CURSOR: + cursor->ns.object = [NSCursor closedHandCursor]; + break; + case GLFW_NOT_ALLOWED_CURSOR: + cursor->ns.object = [NSCursor operationNotAllowedCursor]; + break; + } } if (!cursor->ns.object) diff --git a/src/win32_window.c b/src/win32_window.c index ce06d37c..febafae4 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -2123,30 +2123,41 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) { int id = 0; - if (shape == GLFW_ARROW_CURSOR) - id = OCR_NORMAL; - else if (shape == GLFW_IBEAM_CURSOR) - id = OCR_IBEAM; - else if (shape == GLFW_CROSSHAIR_CURSOR) - id = OCR_CROSS; - else if (shape == GLFW_POINTING_HAND_CURSOR) - id = OCR_HAND; - else if (shape == GLFW_RESIZE_EW_CURSOR) - id = OCR_SIZEWE; - else if (shape == GLFW_RESIZE_NS_CURSOR) - id = OCR_SIZENS; - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - id = OCR_SIZENWSE; - else if (shape == GLFW_RESIZE_NESW_CURSOR) - id = OCR_SIZENESW; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - id = OCR_SIZEALL; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - id = OCR_NO; - else + switch (shape) { - _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Unknown standard cursor"); - return GLFW_FALSE; + case GLFW_ARROW_CURSOR: + id = OCR_NORMAL; + break; + case GLFW_IBEAM_CURSOR: + id = OCR_IBEAM; + break; + case GLFW_CROSSHAIR_CURSOR: + id = OCR_CROSS; + break; + case GLFW_POINTING_HAND_CURSOR: + id = OCR_HAND; + break; + case GLFW_RESIZE_EW_CURSOR: + id = OCR_SIZEWE; + break; + case GLFW_RESIZE_NS_CURSOR: + id = OCR_SIZENS; + break; + case GLFW_RESIZE_NWSE_CURSOR: + id = OCR_SIZENWSE; + break; + case GLFW_RESIZE_NESW_CURSOR: + id = OCR_SIZENESW; + break; + case GLFW_RESIZE_ALL_CURSOR: + id = OCR_SIZEALL; + break; + case GLFW_NOT_ALLOWED_CURSOR: + id = OCR_NO; + break; + default: + _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Unknown standard cursor"); + return GLFW_FALSE; } cursor->win32.handle = LoadImageW(NULL, diff --git a/src/wl_window.c b/src/wl_window.c index 8899a44b..939f9c19 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1242,26 +1242,39 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) const char* name = NULL; // Try the XDG names first - if (shape == GLFW_ARROW_CURSOR) - name = "default"; - else if (shape == GLFW_IBEAM_CURSOR) - name = "text"; - else if (shape == GLFW_CROSSHAIR_CURSOR) - name = "crosshair"; - else if (shape == GLFW_POINTING_HAND_CURSOR) - name = "pointer"; - else if (shape == GLFW_RESIZE_EW_CURSOR) - name = "ew-resize"; - else if (shape == GLFW_RESIZE_NS_CURSOR) - name = "ns-resize"; - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - name = "nwse-resize"; - else if (shape == GLFW_RESIZE_NESW_CURSOR) - name = "nesw-resize"; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - name = "all-scroll"; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - name = "not-allowed"; + switch (shape) + { + case GLFW_ARROW_CURSOR: + name = "default"; + break; + case GLFW_IBEAM_CURSOR: + name = "text"; + break; + case GLFW_CROSSHAIR_CURSOR: + name = "crosshair"; + break; + case GLFW_POINTING_HAND_CURSOR: + name = "pointer"; + break; + case GLFW_RESIZE_EW_CURSOR: + name = "ew-resize"; + break; + case GLFW_RESIZE_NS_CURSOR: + name = "ns-resize"; + break; + case GLFW_RESIZE_NWSE_CURSOR: + name = "nwse-resize"; + break; + case GLFW_RESIZE_NESW_CURSOR: + name = "nesw-resize"; + break; + case GLFW_RESIZE_ALL_CURSOR: + name = "all-scroll"; + break; + case GLFW_NOT_ALLOWED_CURSOR: + name = "not-allowed"; + break; + } cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name); @@ -1274,25 +1287,26 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) if (!cursor->wl.cursor) { // Fall back to the core X11 names - if (shape == GLFW_ARROW_CURSOR) - name = "left_ptr"; - else if (shape == GLFW_IBEAM_CURSOR) - name = "xterm"; - else if (shape == GLFW_CROSSHAIR_CURSOR) - name = "crosshair"; - else if (shape == GLFW_POINTING_HAND_CURSOR) - name = "hand2"; - else if (shape == GLFW_RESIZE_EW_CURSOR) - name = "sb_h_double_arrow"; - else if (shape == GLFW_RESIZE_NS_CURSOR) - name = "sb_v_double_arrow"; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - name = "fleur"; - else + switch (shape) { - _glfwInputError(GLFW_CURSOR_UNAVAILABLE, - "Wayland: Standard cursor shape unavailable"); - return GLFW_FALSE; + case GLFW_ARROW_CURSOR: + name = "left_ptr"; + case GLFW_IBEAM_CURSOR: + name = "xterm"; + case GLFW_CROSSHAIR_CURSOR: + name = "crosshair"; + case GLFW_POINTING_HAND_CURSOR: + name = "hand2"; + case GLFW_RESIZE_EW_CURSOR: + name = "sb_h_double_arrow"; + case GLFW_RESIZE_NS_CURSOR: + name = "sb_v_double_arrow"; + case GLFW_RESIZE_ALL_CURSOR: + name = "fleur"; + default: + _glfwInputError(GLFW_CURSOR_UNAVAILABLE, + "Wayland: Standard cursor shape unavailable"); + return GLFW_FALSE; } cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name); diff --git a/src/x11_window.c b/src/x11_window.c index 4cd32940..a85688e1 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2935,26 +2935,39 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) const int size = XcursorGetDefaultSize(_glfw.x11.display); const char* name = NULL; - if (shape == GLFW_ARROW_CURSOR) - name = "default"; - else if (shape == GLFW_IBEAM_CURSOR) - name = "text"; - else if (shape == GLFW_CROSSHAIR_CURSOR) - name = "crosshair"; - else if (shape == GLFW_POINTING_HAND_CURSOR) - name = "pointer"; - else if (shape == GLFW_RESIZE_EW_CURSOR) - name = "ew-resize"; - else if (shape == GLFW_RESIZE_NS_CURSOR) - name = "ns-resize"; - else if (shape == GLFW_RESIZE_NWSE_CURSOR) - name = "nwse-resize"; - else if (shape == GLFW_RESIZE_NESW_CURSOR) - name = "nesw-resize"; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - name = "all-scroll"; - else if (shape == GLFW_NOT_ALLOWED_CURSOR) - name = "not-allowed"; + switch (shape) + { + case GLFW_ARROW_CURSOR: + name = "default"; + break; + case GLFW_IBEAM_CURSOR: + name = "text"; + break; + case GLFW_CROSSHAIR_CURSOR: + name = "crosshair"; + break; + case GLFW_POINTING_HAND_CURSOR: + name = "pointer"; + break; + case GLFW_RESIZE_EW_CURSOR: + name = "ew-resize"; + break; + case GLFW_RESIZE_NS_CURSOR: + name = "ns-resize"; + break; + case GLFW_RESIZE_NWSE_CURSOR: + name = "nwse-resize"; + break; + case GLFW_RESIZE_NESW_CURSOR: + name = "nesw-resize"; + break; + case GLFW_RESIZE_ALL_CURSOR: + name = "all-scroll"; + break; + case GLFW_NOT_ALLOWED_CURSOR: + name = "not-allowed"; + break; + } XcursorImage* image = XcursorLibraryLoadImage(name, theme, size); if (image) @@ -2969,25 +2982,33 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) { unsigned int native = 0; - if (shape == GLFW_ARROW_CURSOR) - native = XC_left_ptr; - else if (shape == GLFW_IBEAM_CURSOR) - native = XC_xterm; - else if (shape == GLFW_CROSSHAIR_CURSOR) - native = XC_crosshair; - else if (shape == GLFW_POINTING_HAND_CURSOR) - native = XC_hand2; - else if (shape == GLFW_RESIZE_EW_CURSOR) - native = XC_sb_h_double_arrow; - else if (shape == GLFW_RESIZE_NS_CURSOR) - native = XC_sb_v_double_arrow; - else if (shape == GLFW_RESIZE_ALL_CURSOR) - native = XC_fleur; - else + switch (shape) { - _glfwInputError(GLFW_CURSOR_UNAVAILABLE, - "X11: Standard cursor shape unavailable"); - return GLFW_FALSE; + case GLFW_ARROW_CURSOR: + native = XC_left_ptr; + break; + case GLFW_IBEAM_CURSOR: + native = XC_xterm; + break; + case GLFW_CROSSHAIR_CURSOR: + native = XC_crosshair; + break; + case GLFW_POINTING_HAND_CURSOR: + native = XC_hand2; + break; + case GLFW_RESIZE_EW_CURSOR: + native = XC_sb_h_double_arrow; + break; + case GLFW_RESIZE_NS_CURSOR: + native = XC_sb_v_double_arrow; + break; + case GLFW_RESIZE_ALL_CURSOR: + native = XC_fleur; + break; + default: + _glfwInputError(GLFW_CURSOR_UNAVAILABLE, + "X11: Standard cursor shape unavailable"); + return GLFW_FALSE; } cursor->x11.handle = XCreateFontCursor(_glfw.x11.display, native); From 1adfbde4d7fb862bb36d4a20e05d16bf712170f3 Mon Sep 17 00:00:00 2001 From: Nicolas Caramelli Date: Mon, 19 Oct 2020 22:00:30 +0200 Subject: [PATCH 36/63] Wayland: Move 96 DPI default to outputHandleMode Closes #1792. --- src/wl_init.c | 13 ------------- src/wl_monitor.c | 9 +++++++++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/wl_init.c b/src/wl_init.c index d3e777d4..21a808aa 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -1038,8 +1038,6 @@ int _glfwPlatformInit(void) char *cursorSizeEnd; long cursorSizeLong; int cursorSize; - int i; - _GLFWmonitor* monitor; _glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0"); if (!_glfw.wl.cursor.handle) @@ -1148,17 +1146,6 @@ int _glfwPlatformInit(void) // Sync so we got all initial output events wl_display_roundtrip(_glfw.wl.display); - for (i = 0; i < _glfw.monitorCount; ++i) - { - monitor = _glfw.monitors[i]; - if (monitor->widthMM <= 0 || monitor->heightMM <= 0) - { - // If Wayland does not provide a physical size, assume the default 96 DPI - monitor->widthMM = (int) (monitor->modes[monitor->wl.currentMode].width * 25.4f / 96.f); - monitor->heightMM = (int) (monitor->modes[monitor->wl.currentMode].height * 25.4f / 96.f); - } - } - _glfwInitTimerPOSIX(); _glfw.wl.timerfd = -1; diff --git a/src/wl_monitor.c b/src/wl_monitor.c index a6356de0..4cbfb51d 100644 --- a/src/wl_monitor.c +++ b/src/wl_monitor.c @@ -81,7 +81,16 @@ static void outputHandleMode(void* data, monitor->modes[monitor->modeCount - 1] = mode; if (flags & WL_OUTPUT_MODE_CURRENT) + { monitor->wl.currentMode = monitor->modeCount - 1; + + if (monitor->widthMM <= 0 || monitor->heightMM <= 0) + { + // If Wayland does not provide a physical size, assume the default 96 DPI + monitor->widthMM = (int) (width * 25.4f / 96.f); + monitor->heightMM = (int) (height * 25.4f / 96.f); + } + } } static void outputHandleDone(void* data, struct wl_output* output) From 0b9e48fa3df9c184ff1abfb2452fd1a4b696ecd8 Mon Sep 17 00:00:00 2001 From: Bhee Date: Mon, 14 Dec 2020 02:37:20 -0500 Subject: [PATCH 37/63] Fix minor typo: If if -> If. --- docs/vulkan.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/vulkan.dox b/docs/vulkan.dox index 2585c2bb..68e3d5fe 100644 --- a/docs/vulkan.dox +++ b/docs/vulkan.dox @@ -93,7 +93,7 @@ if (glfwVulkanSupported()) This function returns `GLFW_TRUE` if the Vulkan loader and any minimally functional ICD was found. -If if one or both were not found, calling any other Vulkan related GLFW function +If one or both were not found, calling any other Vulkan related GLFW function will generate a @ref GLFW_API_UNAVAILABLE error. From 761f97d6b600794062bc2c6055d7d09ae6a567fc Mon Sep 17 00:00:00 2001 From: ashishgamedev <66940640+ashishgamedev@users.noreply.github.com> Date: Thu, 10 Dec 2020 19:48:55 +0530 Subject: [PATCH 38/63] Fix indentation in internal.h Closes #1818. --- src/internal.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/internal.h b/src/internal.h index 48053cde..f87c2f93 100644 --- a/src/internal.h +++ b/src/internal.h @@ -350,9 +350,9 @@ struct _GLFWcontext int robustness; int release; - PFNGLGETSTRINGIPROC GetStringi; + PFNGLGETSTRINGIPROC GetStringi; PFNGLGETINTEGERVPROC GetIntegerv; - PFNGLGETSTRINGPROC GetString; + PFNGLGETSTRINGPROC GetString; _GLFWmakecontextcurrentfun makeCurrent; _GLFWswapbuffersfun swapBuffers; @@ -405,23 +405,23 @@ struct _GLFWwindow _GLFWcontext context; struct { - GLFWwindowposfun pos; - GLFWwindowsizefun size; - GLFWwindowclosefun close; - GLFWwindowrefreshfun refresh; - GLFWwindowfocusfun focus; - GLFWwindowiconifyfun iconify; - GLFWwindowmaximizefun maximize; - GLFWframebuffersizefun fbsize; + GLFWwindowposfun pos; + GLFWwindowsizefun size; + GLFWwindowclosefun close; + GLFWwindowrefreshfun refresh; + GLFWwindowfocusfun focus; + GLFWwindowiconifyfun iconify; + GLFWwindowmaximizefun maximize; + GLFWframebuffersizefun fbsize; GLFWwindowcontentscalefun scale; - GLFWmousebuttonfun mouseButton; - GLFWcursorposfun cursorPos; - GLFWcursorenterfun cursorEnter; - GLFWscrollfun scroll; - GLFWkeyfun key; - GLFWcharfun character; - GLFWcharmodsfun charmods; - GLFWdropfun drop; + GLFWmousebuttonfun mouseButton; + GLFWcursorposfun cursorPos; + GLFWcursorenterfun cursorEnter; + GLFWscrollfun scroll; + GLFWkeyfun key; + GLFWcharfun character; + GLFWcharmodsfun charmods; + GLFWdropfun drop; } callbacks; // This is defined in the window API's platform.h From 6ce6b50787e058177aad547aac33015ab298f1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 15 Dec 2020 02:13:24 +0100 Subject: [PATCH 39/63] Add credit Related to #1818. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b4d798b9..71266cf7 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ skills. - Bobyshev Alexander - Matt Arsenault + - ashishgamedev - David Avedissian - Keith Bauer - John Bartholomew From 3a8ebb1903bd556c21c80c23c42da361b143a051 Mon Sep 17 00:00:00 2001 From: Luke Bayes Date: Sat, 2 Jan 2021 19:55:31 -0500 Subject: [PATCH 40/63] Added 2 entries to the gitignores file. I downloaded and built from sources as as submodule for a personal exploration that I'm working on and discovered that the glfw submodule shows changed files after a build. Adding these 2 entries fixes the issue. Closes #1827. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b34fc452..84636a0a 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,7 @@ examples/splitview examples/sharing examples/triangle-opengl examples/wave +examples/windows tests/*.app tests/*.exe tests/clipboard @@ -87,6 +88,7 @@ tests/gamma tests/glfwinfo tests/icon tests/iconify +tests/inputlag tests/joysticks tests/monitors tests/msaa From 5d1d1a01e3a05c068289487831940896d9a5902e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 3 Jan 2021 21:13:02 +0100 Subject: [PATCH 41/63] Update repo URL for Nuklear Fixes #1826. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71266cf7..a7a1d738 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ located in the `deps/` directory. functions - [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in examples - - [Nuklear](https://github.com/vurtun/nuklear) for test and example UI + - [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) for test and example UI - [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can From f5af421a6b9910ae8d02c4f468ec6d130052c351 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Tue, 5 Jan 2021 20:42:46 -0800 Subject: [PATCH 42/63] Cocoa: Fix duplicate video mode detection Closes #1830. --- src/cocoa_monitor.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index 2bb83738..d0112d26 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -527,7 +527,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) } // Skip duplicate modes - if (i < *count) + if (j < *count) continue; (*count)++; From 552209fe465b3c3d8bc4e2b02e0b259364d2a3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 18 Jan 2021 16:24:27 +0100 Subject: [PATCH 43/63] Update changelog --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a7a1d738..5e06e990 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,7 @@ information on what to include when reporting a bug. - [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays could leak memory - [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787) + - [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) From 8b118674643b199fc28d11dc22039ffe528970b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 8 Dec 2020 23:23:20 +0100 Subject: [PATCH 44/63] Cocoa: Fix menubar for unbundled apps on 10.15 NSApp setActivationPolicy: was being called too soon when the app was not bundled and launched from the command line. This fix is based on #1802 by @richardwilkes. Fixes #1648. Closes #1802. --- README.md | 3 +++ src/cocoa_init.m | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e06e990..5b76f5bb 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,8 @@ information on what to include when reporting a bug. could leak memory - [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787) - [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830) + - [Cocoa] Bugfix: Menubar was not clickable on macOS 10.15+ until it lost and + regained focus (#1648,#1802) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) @@ -441,6 +443,7 @@ skills. - Frank Wille - Andy Williams - Joel Winarske + - Richard A. Wilkes - Tatsuya Yatagawa - Ryogo Yoshimura - Lukas Zanner diff --git a/src/cocoa_init.m b/src/cocoa_init.m index edd174be..88decab6 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -428,9 +428,6 @@ static GLFWbool initializeTIS(void) { if (_glfw.hints.init.ns.menubar) { - // In case we are unbundled, make us a proper UI application - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - // Menu bar setup must go between sharedApplication and finishLaunching // in order to properly emulate the behavior of NSApplicationMain @@ -557,6 +554,9 @@ int _glfwPlatformInit(void) if (![[NSRunningApplication currentApplication] isFinishedLaunching]) [NSApp run]; + // In case we are unbundled, make us a proper UI application + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + return GLFW_TRUE; } // autoreleasepool From 5aff72aa0016105477b9ce16f2da590939cec981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 18 Jan 2021 01:26:00 +0100 Subject: [PATCH 45/63] Cocoa: Fix duplicate monitor connection events --- src/cocoa_monitor.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index d0112d26..8891f8a6 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -338,7 +338,8 @@ void _glfwPollMonitorsNS(void) // display replacement on machines with automatic graphics // switching const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]); - for (uint32_t j = 0; j < disconnectedCount; j++) + uint32_t j; + for (j = 0; j < disconnectedCount; j++) { if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber) { @@ -347,6 +348,9 @@ void _glfwPollMonitorsNS(void) } } + if (j < disconnectedCount) + continue; + const CGSize size = CGDisplayScreenSize(displays[i]); char* name = getDisplayName(displays[i]); if (!name) From 2bc52ca82e46f6f238007b8e80b7253328bd080d Mon Sep 17 00:00:00 2001 From: Nevyn Bengtsson Date: Mon, 11 Jan 2021 17:27:27 +0100 Subject: [PATCH 46/63] Cocoa: Use modern API to get display name On Apple Silicon, IOKit is deprecated and there will be no matching io_service that we can query for name. Luckilly, NSScreen got an API to fetch the display name in 10.15. This is a blocker to get glfw running on Apple Silicon. Fixes #1809. Closes #1833. --- src/cocoa_monitor.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index 8891f8a6..d85d2621 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -41,6 +41,22 @@ // static char* getDisplayName(CGDirectDisplayID displayID) { + // IOKit doesn't work on Apple Silicon anymore. Luckilly, 10.15 introduced -[NSScreen localizedName]. + // Use it if available, and fall back to IOKit otherwise. + if ([NSScreen instancesRespondToSelector:@selector(localizedName)]) + { + for(NSScreen *screen in [NSScreen screens]) + { + if ([[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue] == displayID) + { + NSString *name = [screen valueForKey:@"localizedName"]; + if (name) + { + return _glfw_strdup([name UTF8String]); + } + } + } + } io_iterator_t it; io_service_t service; CFDictionaryRef info; From 8ab40399d3bdbf8fb9501e42e53f36b5e5528da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 18 Jan 2021 01:34:55 +0100 Subject: [PATCH 47/63] Update changelog and add credit Related to #1833. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5b76f5bb..f5783f5c 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,7 @@ information on what to include when reporting a bug. - [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830) - [Cocoa] Bugfix: Menubar was not clickable on macOS 10.15+ until it lost and regained focus (#1648,#1802) + - [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) @@ -257,6 +258,7 @@ skills. - Coşku Baş - Niklas Behrens - Andrew Belt + - Nevyn Bengtsson - Niklas Bergström - Denis Bernard - Doug Binks From 3959ee894952f7dcba4e46bdd5d34e4528701cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 17 Jan 2021 19:49:51 +0100 Subject: [PATCH 48/63] Cocoa: Unify CG display to NS screen mapping This moves the matching of CG displays to NS screens to monitor enumeration time. --- src/cocoa_monitor.m | 79 +++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index d85d2621..8eb3f70d 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -39,24 +39,21 @@ // Get the name of the specified display, or NULL // -static char* getDisplayName(CGDirectDisplayID displayID) +static char* getMonitorName(CGDirectDisplayID displayID, NSScreen* screen) { - // IOKit doesn't work on Apple Silicon anymore. Luckilly, 10.15 introduced -[NSScreen localizedName]. + // IOKit doesn't work on Apple Silicon anymore + // Luckily, 10.15 introduced -[NSScreen localizedName]. // Use it if available, and fall back to IOKit otherwise. - if ([NSScreen instancesRespondToSelector:@selector(localizedName)]) + if (screen) { - for(NSScreen *screen in [NSScreen screens]) + if ([screen respondsToSelector:@selector(localizedName)]) { - if ([[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue] == displayID) - { - NSString *name = [screen valueForKey:@"localizedName"]; - if (name) - { - return _glfw_strdup([name UTF8String]); - } - } + NSString* name = [screen valueForKey:@"localizedName"]; + if (name) + return _glfw_strdup([name UTF8String]); } } + io_iterator_t it; io_service_t service; CFDictionaryRef info; @@ -225,31 +222,6 @@ static void endFadeReservation(CGDisplayFadeReservationToken token) } } -// Finds and caches the NSScreen corresponding to the specified monitor -// -static GLFWbool refreshMonitorScreen(_GLFWmonitor* monitor) -{ - if (monitor->ns.screen) - return GLFW_TRUE; - - for (NSScreen* screen in [NSScreen screens]) - { - NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"]; - - // HACK: Compare unit numbers instead of display IDs to work around - // display replacement on machines with automatic graphics - // switching - if (monitor->ns.unitNumber == CGDisplayUnitNumber([displayID unsignedIntValue])) - { - monitor->ns.screen = screen; - return GLFW_TRUE; - } - } - - _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find a screen for monitor"); - return GLFW_FALSE; -} - // Returns the display refresh rate queried from the I/O registry // static double getFallbackRefreshRate(CGDirectDisplayID displayID) @@ -350,15 +322,29 @@ void _glfwPollMonitorsNS(void) if (CGDisplayIsAsleep(displays[i])) continue; + const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]); + NSScreen* screen = nil; + + for (screen in [NSScreen screens]) + { + NSNumber* screenNumber = [screen deviceDescription][@"NSScreenNumber"]; + + // HACK: Compare unit numbers instead of display IDs to work around + // display replacement on machines with automatic graphics + // switching + if (CGDisplayUnitNumber([screenNumber unsignedIntValue]) == unitNumber) + break; + } + // HACK: Compare unit numbers instead of display IDs to work around // display replacement on machines with automatic graphics // switching - const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]); uint32_t j; for (j = 0; j < disconnectedCount; j++) { if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber) { + disconnected[j]->ns.screen = screen; disconnected[j] = NULL; break; } @@ -368,13 +354,14 @@ void _glfwPollMonitorsNS(void) continue; const CGSize size = CGDisplayScreenSize(displays[i]); - char* name = getDisplayName(displays[i]); + char* name = getMonitorName(displays[i], screen); if (!name) name = _glfw_strdup("Unknown"); _GLFWmonitor* monitor = _glfwAllocMonitor(name, size.width, size.height); monitor->ns.displayID = displays[i]; monitor->ns.unitNumber = unitNumber; + monitor->ns.screen = screen; free(name); @@ -483,8 +470,11 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, { @autoreleasepool { - if (!refreshMonitorScreen(monitor)) - return; + if (!monitor->ns.screen) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Cannot query content scale without screen"); + } const NSRect points = [monitor->ns.screen frame]; const NSRect pixels = [monitor->ns.screen convertRectToBacking:points]; @@ -503,8 +493,11 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, { @autoreleasepool { - if (!refreshMonitorScreen(monitor)) - return; + if (!monitor->ns.screen) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Cannot query workarea without screen"); + } const NSRect frameRect = [monitor->ns.screen visibleFrame]; From f8d6801a507ff5a5b41f30347dd03f1e38a0f9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 18 Jan 2021 16:04:51 +0100 Subject: [PATCH 49/63] Simplify references in CMake if-statements --- src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a45ea50..4a0f5340 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,7 @@ elseif (_GLFW_OSMESA) endif() if (_GLFW_X11 OR _GLFW_WAYLAND) - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") target_sources(glfw PRIVATE linux_joystick.h linux_joystick.c) else() target_sources(glfw PRIVATE null_joystick.h null_joystick.c) @@ -120,7 +120,7 @@ endif() # Make GCC warn about declarations that VS 2010 and 2012 won't accept for all # source files that VS will build (Clang ignores this because we set -std=c99) -if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") +if (CMAKE_C_COMPILER_ID STREQUAL "GNU") set_source_files_properties(context.c init.c input.c monitor.c vulkan.c window.c win32_init.c win32_joystick.c win32_monitor.c win32_time.c win32_thread.c @@ -130,11 +130,11 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") endif() # Enable a reasonable set of warnings -if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR - "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") +if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR + CMAKE_C_COMPILER_ID STREQUAL "Clang" OR + CMAKE_C_COMPILER_ID STREQUAL "AppleClang") - if ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") + if (CMAKE_C_SIMULATE_ID STREQUAL "MSVC") # Tell Clang-CL that this is a Clang flag target_compile_options(glfw PRIVATE "/clang:-Wall") else() From 384ff74a4645347bbc5726fc572138b38f87ae8b Mon Sep 17 00:00:00 2001 From: Laurent Aphecetche Date: Fri, 14 Jun 2019 16:42:50 +0200 Subject: [PATCH 50/63] Cocoa: Fix install name for installed dylib The install name was incorrectly set to a relative path. This change leaves the install name of the installed dylib as @rpath/soname. Those who wish to override this can set the CMAKE_INSTALL_NAME_DIR variable. Closes #1504. --- src/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a0f5340..2e6a1fa2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -203,9 +203,6 @@ if (BUILD_SHARED_LIBS) endif() target_compile_definitions(glfw INTERFACE GLFW_DLL) - elseif (APPLE) - set_target_properties(glfw PROPERTIES - INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}") endif() if (MINGW) From 94773111300fee0453844a4c9407af7e880b4df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 18 Jan 2021 18:55:17 +0100 Subject: [PATCH 51/63] Update changelog and add credit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f5783f5c..3185b6cc 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ information on what to include when reporting a bug. - [Cocoa] Bugfix: Menubar was not clickable on macOS 10.15+ until it lost and regained focus (#1648,#1802) - [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833) + - [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) @@ -250,6 +251,7 @@ GLFW exists because people around the world donated their time and lent their skills. - Bobyshev Alexander + - Laurent Aphecetche - Matt Arsenault - ashishgamedev - David Avedissian From 6de084000bbebec345f4e5845a92fb2f4f931c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 10 Feb 2021 17:23:43 +0100 Subject: [PATCH 52/63] Cocoa: Fix console apps getting a dock icon Regression introduced by @elmindreda in 8b118674643b199fc28d11dc22039ffe528970b3. --- src/cocoa_init.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 88decab6..626d95c2 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -555,7 +555,8 @@ int _glfwPlatformInit(void) [NSApp run]; // In case we are unbundled, make us a proper UI application - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + if (_glfw.hints.init.ns.menubar) + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; return GLFW_TRUE; From 410890aa8058a0c5a33f2e00d750326ba412e466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 19 Jan 2021 22:25:05 +0100 Subject: [PATCH 53/63] Win32: Fix full screen windows affected by scaling Per-monitor DPI scaling should not affect full screen windows. Fixes #1582. --- README.md | 2 ++ src/win32_window.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3185b6cc..73dc1acd 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,8 @@ information on what to include when reporting a bug. configuration change (#1761) - [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775) - [Win32] Bugfix: Duplicate size events were not filtered (#1610) + - [Win32] Bugfix: Full screen windows were incorrectly resized by DPI changes + (#1582) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) diff --git a/src/win32_window.c b/src/win32_window.c index febafae4..1fa4570a 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1140,7 +1140,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, // Only apply the suggested size if the OS is new enough to have // sent a WM_GETDPISCALEDSIZE before this - if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32()) + if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32() && !window->monitor) { RECT* suggested = (RECT*) lParam; SetWindowPos(window->win32.handle, HWND_TOP, From 729c9988d02004faac1663c18c7628bae193a95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 20 Jan 2021 01:02:24 +0100 Subject: [PATCH 54/63] Win32: Fix content area rescaling on older systems GLFW_SCALE_TO_MONITOR had no effect on Windows 8.1 up to and including Windows 10 version 1607 (Anniversary Update), despite those having support for per-monitor DPI. That done was to avoid handling systems that have non-client scaling, introduced in Windows 10 version 1607, without reliable overriding of the new window size, introduced in Windows 10 version 1703 (Creators Update). Both are needed to keep the content area at a fixed size for windows that have GLFW_SCALE_TO_MONITOR disabled. This change enables window rescaling on Windows 8.1 and all later versions but disables non-client scaling for unscaled windows on Windows 10 version 1607. Versions after 1607 are unaffected. Fixes #1511. --- README.md | 2 ++ src/win32_window.c | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 73dc1acd..b0774fc4 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,8 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Duplicate size events were not filtered (#1610) - [Win32] Bugfix: Full screen windows were incorrectly resized by DPI changes (#1582) + - [Win32] Bugfix: `GLFW_SCALE_TO_MONITOR` had no effect on systems older than + Windows 10 version 1703 (#1511) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) diff --git a/src/win32_window.c b/src/win32_window.c index 1fa4570a..52a9c680 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -501,7 +501,17 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_NCCREATE: { if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32()) - EnableNonClientDpiScaling(hWnd); + { + const CREATESTRUCTW* cs = (const CREATESTRUCTW*) lParam; + const _GLFWwndconfig* wndconfig = cs->lpCreateParams; + + // On per-monitor DPI aware V1 systems, only enable + // non-client scaling for windows that scale the client area + // We need WM_GETDPISCALEDSIZE from V2 to keep the client + // area static when the non-client area is scaled + if (wndconfig && wndconfig->scaleToMonitor) + EnableNonClientDpiScaling(hWnd); + } break; } @@ -1138,9 +1148,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, const float xscale = HIWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI; const float yscale = LOWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI; - // Only apply the suggested size if the OS is new enough to have - // sent a WM_GETDPISCALEDSIZE before this - if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32() && !window->monitor) + // Resize windowed mode windows that either permit rescaling or that + // need it to compensate for non-client area scaling + if (!window->monitor && + (window->win32.scaleToMonitor || + _glfwIsWindows10CreatorsUpdateOrGreaterWin32())) { RECT* suggested = (RECT*) lParam; SetWindowPos(window->win32.handle, HWND_TOP, @@ -1255,7 +1267,7 @@ static int createNativeWindow(_GLFWwindow* window, NULL, // No parent window NULL, // No window menu GetModuleHandleW(NULL), - NULL); + (LPVOID) wndconfig); free(wideTitle); From b925a54ef11adab250e4e9592afe918c1f8caebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 9 Feb 2021 21:33:23 +0100 Subject: [PATCH 55/63] Wayland: Move DPI fallback work to output done This removes the dependency on the (unspecified) ordering of geometry and mode events in wl_output. Based on feedback from @linkmauve and @caramelli. Related to #1792. --- src/wl_monitor.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/wl_monitor.c b/src/wl_monitor.c index 4cbfb51d..d722beaa 100644 --- a/src/wl_monitor.c +++ b/src/wl_monitor.c @@ -81,22 +81,21 @@ static void outputHandleMode(void* data, monitor->modes[monitor->modeCount - 1] = mode; if (flags & WL_OUTPUT_MODE_CURRENT) - { monitor->wl.currentMode = monitor->modeCount - 1; - - if (monitor->widthMM <= 0 || monitor->heightMM <= 0) - { - // If Wayland does not provide a physical size, assume the default 96 DPI - monitor->widthMM = (int) (width * 25.4f / 96.f); - monitor->heightMM = (int) (height * 25.4f / 96.f); - } - } } static void outputHandleDone(void* data, struct wl_output* output) { struct _GLFWmonitor *monitor = data; + if (monitor->widthMM <= 0 || monitor->heightMM <= 0) + { + // If Wayland does not provide a physical size, assume the default 96 DPI + const GLFWvidmode* mode = &monitor->modes[monitor->wl.currentMode]; + monitor->widthMM = (int) (mode->width * 25.4f / 96.f); + monitor->heightMM = (int) (mode->height * 25.4f / 96.f); + } + _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); } From 2c7f3ce91b4f22773855c43d6480824ed4ac9907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 17 Feb 2021 21:21:49 +0100 Subject: [PATCH 56/63] Update changelog --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b0774fc4..b9b047f0 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,7 @@ information on what to include when reporting a bug. (#1463) - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder (#1798) + - [Wayland] Bugfix: Monitors physical size could report zero (#1784,#1792) - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer From 4afa227a056681d2628894b0893527bf69496a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 8 Mar 2021 19:32:36 +0100 Subject: [PATCH 57/63] X11: Fix attribs not applied on leaving fullscreen If the GLFW_DECORATED and/or GLFW_FLOATING window attributes were changed while in fullscreen mode, the changes did not take effect when the window entered windowed mode. Bug reported on the GLFW forum. https://discourse.glfw.org/t/turning-on-off-window-decorations-while-in-full-screen-wont-work-properly/1780 --- README.md | 1 + src/x11_window.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index b9b047f0..9e4f2df9 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ information on what to include when reporting a bug. combinaitons (#1598) - [X11] Bugfix: Keys pressed simultaneously with others were not always reported (#1112,#1415,#1472,#1616) + - [X11] Bugfix: Some window attributes were not applied on leaving fullscreen - [Wayland] Removed support for `wl_shell` (#1443) - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432) - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled diff --git a/src/x11_window.c b/src/x11_window.c index a85688e1..3f2277d6 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2485,7 +2485,11 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, } if (window->monitor) + { + _glfwPlatformSetWindowDecorated(window, window->decorated); + _glfwPlatformSetWindowFloating(window, window->floating); releaseMonitor(window); + } _glfwInputWindowMonitor(window, monitor); updateNormalHints(window, width, height); From 1f34295a74ecbbe87d95ad39ce1cd0d943f88dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 9 Mar 2021 23:36:05 +0100 Subject: [PATCH 58/63] Win32: Add MinGW-w64 detection to version string --- src/win32_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/win32_init.c b/src/win32_init.c index f6995e51..4cd6f158 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -614,7 +614,9 @@ void _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { return _GLFW_VERSION_NUMBER " Win32 WGL EGL OSMesa" -#if defined(__MINGW32__) +#if defined(__MINGW64_VERSION_MAJOR) + " MinGW-w64" +#elif defined(__MINGW32__) " MinGW" #elif defined(_MSC_VER) " VisualC" From 9c62a21ba91d347617856dee9ccdf6da1175a83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 10 Mar 2021 21:39:16 +0100 Subject: [PATCH 59/63] Update linmath.h --- deps/linmath.h | 151 +++++++++++++++++++++---------------------------- 1 file changed, 66 insertions(+), 85 deletions(-) diff --git a/deps/linmath.h b/deps/linmath.h index 8b2a8c2e..be37caf6 100644 --- a/deps/linmath.h +++ b/deps/linmath.h @@ -1,13 +1,8 @@ #ifndef LINMATH_H #define LINMATH_H +#include #include - -/* 2020-03-02 Camilla Löwy - * - Added inclusion of string.h for memcpy - * - Replaced tan and acos with tanf and acosf - * - Replaced double constants with float equivalents - */ #include #ifdef LINMATH_NO_INLINE @@ -38,7 +33,7 @@ LINMATH_H_FUNC void vec##n##_scale(vec##n r, vec##n const v, float const s) \ } \ LINMATH_H_FUNC float vec##n##_mul_inner(vec##n const a, vec##n const b) \ { \ - float p = 0.; \ + float p = 0.f; \ int i; \ for(i=0; ib[i] ? a[i] : b[i]; \ +} \ +LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \ +{ \ + int i; \ + for(i=0; i Date: Thu, 20 Aug 2020 12:54:07 +0200 Subject: [PATCH 60/63] Ignore cached state when setting window attributes This filtering prevented valid changes if the native window state was changed externally. --- src/window.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/window.c b/src/window.c index efcb4125..d2196e2f 100644 --- a/src/window.c +++ b/src/window.c @@ -882,27 +882,18 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) window->autoIconify = value; else if (attrib == GLFW_RESIZABLE) { - if (window->resizable == value) - return; - window->resizable = value; if (!window->monitor) _glfwPlatformSetWindowResizable(window, value); } else if (attrib == GLFW_DECORATED) { - if (window->decorated == value) - return; - window->decorated = value; if (!window->monitor) _glfwPlatformSetWindowDecorated(window, value); } else if (attrib == GLFW_FLOATING) { - if (window->floating == value) - return; - window->floating = value; if (!window->monitor) _glfwPlatformSetWindowFloating(window, value); @@ -911,9 +902,6 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) window->focusOnShow = value; else if (attrib == GLFW_MOUSE_PASSTHROUGH) { - if (window->mousePassthrough == value) - return; - window->mousePassthrough = value; _glfwPlatformSetWindowMousePassthrough(window, value); } From 52ba8c7f07574d56955099179f35569e07e2001c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 15 Mar 2021 00:48:05 +0100 Subject: [PATCH 61/63] Win32: Add warning when option will have no effect The GPU driver only looks in the executable for the symbol requesting the high-performance GPU, so enabling them when buidling GLFW as a DLL will have no effect. --- src/win32_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/win32_init.c b/src/win32_init.c index 4cd6f158..970da06e 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -39,6 +39,10 @@ static const GUID _glfw_GUID_DEVINTERFACE_HID = #if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG) +#if defined(_GLFW_BUILD_DLL) + #warning "These symbols must be exported by the executable and have no effect in a DLL" +#endif + // Executables (but not DLLs) exporting this symbol with this value will be // automatically directed to the high-performance GPU on Nvidia Optimus systems // with up-to-date drivers From 291f6dc32c6d6359f56dd495374aea8291357b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 19 Mar 2021 14:24:50 +0100 Subject: [PATCH 62/63] Remove deprecated Doxygen tag Fixes #1867. --- docs/Doxyfile.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index c3682222..f5504a83 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -1074,13 +1074,6 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored From 33cd8b865d9289cfbcf3d95e6e68e4050b94fcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 19 Mar 2021 14:47:28 +0100 Subject: [PATCH 63/63] Add issue number to changelog Related to #1863. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9e4f2df9..26e88828 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,7 @@ information on what to include when reporting a bug. - [X11] Bugfix: Keys pressed simultaneously with others were not always reported (#1112,#1415,#1472,#1616) - [X11] Bugfix: Some window attributes were not applied on leaving fullscreen + (#1863) - [Wayland] Removed support for `wl_shell` (#1443) - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432) - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled